<template>
  <div class="adminTask" style="background:white;border-radius:5px;">
    <!-- <mu-paper :z-depth="2" class="paperz tttt"> -->
    <!--<div style="color:lightcoral;position:relative;top:-107px;">-->
    <!--*如果买家搜不到或者管关键词千人千面搜索排名非常靠后会导致某个时间段 少单 建议如要放100单-->
    <!--请设置120单即可解决每个时间段少单问题;-->
    <!--</div>-->
    <el-form :inline="true" class="demo-form-inline" style="    margin-top: 20px;">
      <el-form-item>
        <el-select placeholder="请选择" size="mini" style="width: 150px;margin-left:20px;"
                   v-model="searchList.search">
          <el-option :key="index" :label="item.label" :value="item.value" v-for="(item,index) in searchs">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="请输入内容" size="mini" v-model="searchList.searchValue">
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="getTaskList" size="mini">
          搜索
        </el-button>
      </el-form-item>
      <el-form-item>
        <el-button @click="dialogTask1 = true" size="mini" type="primary">
          发布活动
        </el-button>
      </el-form-item>
      <!--<el-form-item>-->
      <!--<el-button type="text" icon="el-icon-question" size="mini" @click="dialogvideo=true"></el-button>-->
      <!--</el-form-item>-->
      <el-form-item>
        <el-input placeholder="请输入多多号" size="mini" v-model="wangwang">
        </el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="clickWangWang" size="mini">
          查询
        </el-button>
      </el-form-item>
    </el-form>
    <el-table :data="tableData" @filter-change="filter" v-loading="loading"
              @selection-change="handleSelectionChange"
              style="width: 100%;">
      <el-table-column type="selection" width="40">
      </el-table-column>
      <el-table-column label="序号" prop="id" width="60">
      </el-table-column>
      <el-table-column label="间隔(分)" prop="taskInterval" width="80">
      </el-table-column>
      <el-table-column label="店铺" prop="shop" width="160">
      </el-table-column>
      <el-table-column label="宝贝ID" prop="babyId" width="110">
        <template slot-scope="props">
          <a :href="'https://detail.tmall.com/item.htm?id=' + props.row.babyId" target="_blank">
            {{props.row.babyId}}
          </a>
        </template>
      </el-table-column>
      <el-table-column label="价格" prop="money" width="70">
      </el-table-column>
      <el-table-column label="产品名称" prop="babyName" width="110">
      </el-table-column>
      <el-table-column label="关键词" prop="keywords" width="110">
      </el-table-column>
      <el-table-column label="排序方式" prop="sort" width="78">
      </el-table-column>
      <el-table-column label="筛选" prop="goods2money" width="78">
      </el-table-column>
      <el-table-column label="已发单数" prop="toNum" width="78">
      </el-table-column>
      <!--  <el-table-column label="已完成" prop="endNum" width="70">
              </el-table-column>-->
      <el-table-column label="进行中" prop="theNum" width="70">
      </el-table-column>
      <el-table-column label="剩余" width="50">
        <template slot-scope="scope">
          {{scope.row.toNum - scope.row.endNum - scope.row.theNum}}
        </template>
      </el-table-column>
      <!-- <el-table-column label="完成率" prop="theNum" width="70">
             </el-table-column>-->
      <el-table-column :filter-multiple="filterStatus.task"
                       :filters="[{ text: '正常', value: '0' }, { text: '暂停', value: '1' }]" column-key="filterTask"
                       filter-placement="bottom-end" label="任务状态" prop="taskStatus" width="90">
        <template slot-scope="scope">
          <div v-if="scope.row.taskStatus === '0'">
            <el-button @click="switchTaskStatus(1,scope.row.id)" type="text">
              已开始
            </el-button>
          </div>
          <div v-if="scope.row.taskStatus === '1'">
            <el-button @click="switchTaskStatus(0,scope.row.id)" style="color: red" type="text">
              暂停
            </el-button>
          </div>
          <div v-if="scope.row.taskStatus === '3'">
            <el-button @click="switchTaskStatus(0,scope.row.id)" style="color: red" type="text">
              待客服激活
            </el-button>
          </div>
        </template>
      </el-table-column>

      <el-table-column label="发布日期" prop="addTime" width="144">
        <template slot-scope="scope">
          {{scope.row.addTime | timeTo(1)}}
        </template>
      </el-table-column>
      <el-table-column label="激活日期" prop="addTime" width="144">
        <template slot-scope="scope">
          {{scope.row.activateTime | timeTo(1)}}
        </template>
      </el-table-column>

      <el-table-column>
        <template slot-scope="scope">
          <el-button @click="ck(scope.row)" size="mini">
            查看
          </el-button>
        </template>
      </el-table-column>
    </el-table>

    <el-pagination :current-page="searchList.pn" :page-size="20" :total="searchList.total"
                   @current-change="pnChange" layout="prev, pager, next" v-if="searchList.total > 20">
    </el-pagination>


    <!--发布任务-->
    <el-dialog :visible.sync="dialogTask1"
               @close="resetList()"
               custom-class="taskDialog1">

      <el-form :inline="true"
               label-width="100px"
               ref="form"
               :model="taskInfoListM"
               :rules="rules">
        <el-row class="one">
          <el-form-item label="">
            <el-radio v-model="taskInfoListM.f"
                      label="运营专员">运营专员
            </el-radio>
            <el-radio v-model="taskInfoListM.f"
                      label="自营">自营
            </el-radio>
          </el-form-item>
          <el-form-item label="专员"
                        size="mini"
                        label-width="90px"
                        prop="zy">
            <el-input style="width: 105px"
                      v-model="taskInfoListM.zy">
            </el-input>
          </el-form-item>
          <el-form-item label="操作员"
                        size="mini"
                        label-width="90px"
                        prop="czy">
            <el-input style="width: 105px"
                      v-model="taskInfoListM.czy">
            </el-input>
          </el-form-item>
          <el-form-item label="美工"
                        size="mini"
                        label-width="90px"
                        prop="mg">
            <el-input style="width: 105px"
                      v-model="taskInfoListM.mg">
            </el-input>
          </el-form-item>
          <el-form-item label="评价维护员"
                        size="mini"
                        prop="pjwhy">
            <el-input style="width: 105px"
                      v-model="taskInfoListM.pjwhy">
            </el-input>
          </el-form-item>
          <el-form-item label="产品经理"
                        size="mini"
                        prop="cpjl">
            <el-input style="width: 105px"
                      v-model="taskInfoListM.cpjl">
            </el-input>
          </el-form-item>
          <el-form-item label="选品人"
                        size="mini"
                        prop="cpjl">
            <el-input style="width: 105px"
                      v-model="taskInfoListM.xpr">
            </el-input>
          </el-form-item>
        </el-row>
        <el-row class="one">
          <el-form-item label="宝贝ID"
                        size="mini"
                        prop="babyId">
            <el-input auto-complete="off"
                      style="width:185px"
                      v-model="taskInfoListM.babyId">
              <el-button @click="getShopInfo('2')"
                         icon="el-icon-search"
                         slot="append">
              </el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="店铺"
                        size="mini"
                        prop="shop">
            <el-input style="width: 194px"
                      v-model="taskInfoListM.shop">
            </el-input>
          </el-form-item>
          <el-form-item label="价格"
                        size="mini"
                        prop="money">
            <el-input style="width: 93px"
                      v-model="taskInfoListM.money">
            </el-input>
          </el-form-item>
          <el-form-item label="产品搜索展示价格:"
                        size="mini"
                        label-width="150px">
            <el-input style="width: 50px"
                      v-model="taskInfoListM.shopmoney">
            </el-input>
          </el-form-item>
          <el-form-item label="购买件数:"
                        size="mini">
            <el-input style="width: 50px"
                      v-model="taskInfoListM.shopnum">
            </el-input>
          </el-form-item>
          <el-form-item label="产品名称"
                        size="mini"
                        prop="babyName">
            <el-input style="width: 185px"
                      v-model="taskInfoListM.babyName">
            </el-input>
          </el-form-item>
          <el-form-item label="类目"
                        size="mini"
                        prop="tag">
            <el-input placeholder="例：化妆品"
                      style="width:100px"
                      v-model="taskInfoListM.tag">
            </el-input>
          </el-form-item>

        </el-row>

        <el-row class="two">
          <el-form-item label="优先级别">
            <el-select v-model="taskInfoListM.lv"
                       style="width: 75px;"
                       size="mini">
              <el-option v-for="item in 5"
                         :key="item"
                         :label="item"
                         :value="item">
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="图片地址"
                        size="mini"
                        prop="img">
            <el-input style="width: 538px"
                      v-model="taskInfoListM.img">
              <el-button icon="el-icon-upload2"
                         slot="append">
              </el-button>
            </el-input>
          </el-form-item>
          <el-form-item label="">
            <el-checkbox label="1"
                         v-model="taskInfoListM.hzp">
              化妆品
            </el-checkbox>
          </el-form-item>
          <el-form-item label="">
            <el-radio v-model="taskInfoListM.type"
                      label="超级爆款模式">超级爆款模式
            </el-radio>
            <el-radio v-model="taskInfoListM.type"
                      label="综合稳定模式">综合稳定模式
            </el-radio>
            <el-radio v-model="taskInfoListM.type"
                      label="淘客模式">淘客模式
            </el-radio>
            <el-radio v-model="taskInfoListM.type"
                      label="地推模式">地推模式
            </el-radio>
            <el-radio v-model="taskInfoListM.type"
                      label="其他模式">其他模式
            </el-radio>
          </el-form-item>
          <el-form-item label="">
            <el-button type="primary"
                       @click="ss.tk=ss.tk==true?false:true">
              + 高级
            </el-button>
          </el-form-item>

        </el-row>
        <section class="t">
          <section class="left">
            <div>
              <font>优惠券设置</font>
              <el-form-item label="优惠券淘口令:"
                            size="mini">
                <el-input style="width: 150px"
                          v-model="taskInfoListM.key"
                          placeholder="优惠券淘口令地址">
                </el-input>
              </el-form-item>
              <el-form-item size="mini">
                <span>使用优惠券后实际支付金额:</span>
                <el-input style="width: 60px"
                          v-model="taskInfoListM.money2">
                </el-input>
              </el-form-item>
              <el-checkbox label=""
                           v-model="taskInfoListM.yhtkl">
                优惠券使用淘口令直接打开连接拍的地址：
              </el-checkbox>
              <el-form-item label=""
                            size="mini"
                            style="position: relative;margin-right:30px !important;"
                            label-width="120px">
                <el-input style="width: 100px;"
                          v-model="taskInfoListM.yhtkl2">
                </el-input>
              </el-form-item>
              <el-button type="primary"
                         @click="chengben(taskInfoListM)">
                成本设置
              </el-button>
            </div>
            <div>
              <font>新增订单类型</font>
              <el-form-item label="">
                <!-- <el-checkbox-group v-model="taskInfoListM.pjyh"> -->
                <el-checkbox label="1"
                             v-model="taskInfoListM.pjyh">
                  评价单使用优惠券
                </el-checkbox>
                <!-- </el-checkbox-group> -->
              </el-form-item>
              <el-form-item label="">

                <el-checkbox label="1"
                             v-model="ss.pjd">
                  评价单
                </el-checkbox>

              </el-form-item>
              <el-form-item label="">

                <el-checkbox label="1"
                             v-model="ss.yhjd">
                  优惠券单
                </el-checkbox>

              </el-form-item>
            </div>
            <div>
              <font>退款单设置</font>
              <el-form-item label="退款单件数:"
                            size="mini">
                <el-input style="width: 100px"
                          v-model="taskInfoListM.tknum">
                </el-input>
              </el-form-item>
              <el-form-item label="退款单金额:"
                            size="mini">
                <el-input style="width: 100px"
                          v-model="taskInfoListM.tkmoney">
                </el-input>
              </el-form-item>
              <br/>
              <el-form-item label=""
                            size="mini">
                <el-checkbox label=""
                             v-model="taskInfoListM.sf5">信誉积分
                </el-checkbox>
                <el-input-number v-model="taskInfoListM.num2"
                                 :min="0"></el-input-number>
                至
                <el-input-number v-model="taskInfoListM.num3"
                                 :min="1"></el-input-number>
              </el-form-item>
            </div>
          </section>
          <section class="right"
                   v-if="ss.tk">
            <el-form-item label=""
                          style="">
              <el-checkbox label="1"
                           v-model="taskInfoListM.tkd">
                退款单
              </el-checkbox>
              <el-checkbox label="1"
                           v-model="taskInfoListM.gyd">
                高佣单
              </el-checkbox>

            </el-form-item>
            <hr style="margin-block-start: 0em;margin-block-end: 0em;border-width:0.5px;width: 100%"/>
            <br/>
            <el-form-item label="年龄限制:"
                          size="mini"
                          label-width="80px">
              <el-input-number style="width: 50px"
                               v-model="taskInfoListM.nlxz"
                               :controls="false">
              </el-input-number>
            </el-form-item>
            <el-form-item label="平均客单价:"
                          size="mini"
                          label-width="95px">
              <el-input-number style="width: 70px"
                               v-model="taskInfoListM.kdj"
                               :controls="false">
              </el-input-number>
            </el-form-item>
            <br/>
            <el-form-item label="性别:"
                          size="mini"
                          label-width="80px">
              <el-radio v-model="taskInfoListM.sex"
                        label="1"
                        style="margin-left: 10px;">男
              </el-radio>
              <el-radio v-model="taskInfoListM.sex"
                        label="2"
                        style="margin-left: 10px;">女
              </el-radio>
              <el-radio v-model="taskInfoListM.sex"
                        label="3"
                        style="margin-left: 10px;">无
              </el-radio>
            </el-form-item>
          </section>
        </section>
        <!-- <el-form-item label="每小时单数" size="mini">
                     <el-input @change="inputchange" style="width:60px" v-model="taskInfoList.taskIntervalNum">
                     </el-input>
                 </el-form-item>
                 <el-select @change="change" placeholder="速度" size="mini" style="width: 95px"
                            v-model="taskInfoList.taskInterval">
                     <el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in options">
                     </el-option>
                 </el-select>-->

        <!-- <el-form-item label="排序方式">
                     <el-radio label="综合排序" v-model="taskInfoListM.sort">
                         综合
                     </el-radio>
                     <el-radio label="销量排序:" v-model="taskInfoListM.sort">
                         销量
                     </el-radio>
                     &lt;!&ndash; <el-radio v-model="taskInfoList.sort" label="价格排序">价格</el-radio>
                      <el-radio v-model="taskInfoList.sort" label="新品排序">新品</el-radio>&ndash;&gt;
                 </el-form-item>-->
        <!-- <el-form-item label="筛选方式:">
                     <el-checkbox-group v-model="taskInfoListM.goods2money">
                         &lt;!&ndash; <el-checkbox label="包邮">包邮</el-checkbox>
                          <el-checkbox label="折扣">折扣</el-checkbox>
                          <el-checkbox label="搭配减价">搭配减价</el-checkbox>
                          <el-checkbox label="满就减">满就减</el-checkbox>&ndash;&gt;
                         <el-checkbox label="货到付款">
                             货到付款
                         </el-checkbox>
                     </el-checkbox-group>
                 </el-form-item>-->
        <el-row class="three">
          佣金总计：
          <span>
            {{(taskInfoList.comMoney * 1 + taskInfoList.teacherMoney * 1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          本金：
          <span>
            {{taskInfoList.money *1 * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          总计：
          <span>
            {{taskInfoList.money *1 * taskInfoList.toNum + (taskInfoList.comMoney*1+taskInfoList.teacherMoney*1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          当日搜索量：
          <span>
            {{taskInfoList.money *1 * taskInfoList.toNum + (taskInfoList.comMoney*1+taskInfoList.teacherMoney*1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          30天总佣金：
          <span>
            {{(taskInfoList.comMoney * 1 + taskInfoList.teacherMoney * 1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          今日完成原价单数：
          <span>
            {{taskInfoList.money *1 * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          今日完成评价单数：
          <span>
            {{taskInfoList.money *1 * taskInfoList.toNum + (taskInfoList.comMoney*1+taskInfoList.teacherMoney*1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          今日完成退款单数：
          <span>
            {{(taskInfoList.comMoney * 1 + taskInfoList.teacherMoney * 1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          今日完成佣金：
          <span>
            {{taskInfoList.money *1 * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          30天完成金额：
          <span>
            {{taskInfoList.money *1 * taskInfoList.toNum + (taskInfoList.comMoney*1+taskInfoList.teacherMoney*1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          30完成单数：
          <span>
            {{(taskInfoList.comMoney * 1 + taskInfoList.teacherMoney * 1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          30天发单数：
          <span>
            {{taskInfoList.money *1 * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          今日订单完成率：
          <span>
            {{taskInfoList.money *1 * taskInfoList.toNum + (taskInfoList.comMoney*1+taskInfoList.teacherMoney*1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>
          任务编码：
          <span>
            {{taskInfoList.money *1 * taskInfoList.toNum + (taskInfoList.comMoney*1+taskInfoList.teacherMoney*1) * (taskInfoList.keywords.toNum1 * 1 + taskInfoList.keywords.toNum2 * 1 + taskInfoList.keywords.toNum3 * 1 + taskInfoList.keywords.toNum4 * 1)}}
          </span>

          任务总Id：x
          <span></span>
        </el-row>
        <el-row class="three">
          总原价单:
          <span style="padding: 0 5px"> {{sum(taskInfoListM.nums[(0)].yj.toNum) +sum(taskInfoListM.nums[(1)].yj.toNum)+sum(taskInfoListM.nums[(2)].yj.toNum)+sum(taskInfoListM.nums[(3)].yj.toNum)+sum(taskInfoListM.nums[(4)].yj.toNum)+sum(taskInfoListM.nums[(5)].yj.toNum) +sum(taskInfoListM.nums[(6)].yj.toNum)}}</span>
          总评价单:
          <span style="padding: 0 5px"> {{sum(taskInfoListM.nums[(0)].pjd.toNum) +sum(taskInfoListM.nums[(1)].pjd.toNum)+sum(taskInfoListM.nums[(2)].pjd.toNum)+sum(taskInfoListM.nums[(3)].pjd.toNum)+sum(taskInfoListM.nums[(4)].pjd.toNum)+sum(taskInfoListM.nums[(5)].pjd.toNum) +sum(taskInfoListM.nums[(6)].pjd.toNum)}}</span>
          总优惠券单:
          <span style="padding: 0 5px"> {{sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum) +sum(taskInfoListM.nums[(0)].dgjc2.toNum) +sum(taskInfoListM.nums[(1)].dgjc2.toNum)+sum(taskInfoListM.nums[(2)].dgjc2.toNum)+sum(taskInfoListM.nums[(3)].dgjc2.toNum)+sum(taskInfoListM.nums[(4)].dgjc2.toNum)+sum(taskInfoListM.nums[(5)].dgjc2.toNum) +sum(taskInfoListM.nums[(6)].dgjc2.toNum)+sum(taskInfoListM.nums[(0)].dgjc1.toNum) +sum(taskInfoListM.nums[(1)].dgjc1.toNum)+sum(taskInfoListM.nums[(2)].dgjc1.toNum)+sum(taskInfoListM.nums[(3)].dgjc1.toNum)+sum(taskInfoListM.nums[(4)].dgjc1.toNum)+sum(taskInfoListM.nums[(5)].dgjc1.toNum) +sum(taskInfoListM.nums[(6)].dgjc1.toNum)}}</span>
          总退款单:
          <span style="padding: 0 5px"> {{sum(taskInfoListM.nums[(0)].tk.toNum) +sum(taskInfoListM.nums[(1)].tk.toNum)+sum(taskInfoListM.nums[(2)].tk.toNum)+sum(taskInfoListM.nums[(3)].tk.toNum)+sum(taskInfoListM.nums[(4)].tk.toNum)+sum(taskInfoListM.nums[(5)].tk.toNum) +sum(taskInfoListM.nums[(6)].tk.toNum)}}</span>
          总单数:
          <span style="padding: 0 5px"> {{zdNum = (sum(taskInfoListM.nums[(0)].yj.toNum) +sum(taskInfoListM.nums[(1)].yj.toNum)+sum(taskInfoListM.nums[(2)].yj.toNum)+sum(taskInfoListM.nums[(3)].yj.toNum)+sum(taskInfoListM.nums[(4)].yj.toNum)+sum(taskInfoListM.nums[(5)].yj.toNum) +sum(taskInfoListM.nums[(6)].yj.toNum) + sum(taskInfoListM.nums[(0)].pjd.toNum) +sum(taskInfoListM.nums[(1)].pjd.toNum)+sum(taskInfoListM.nums[(2)].pjd.toNum)+sum(taskInfoListM.nums[(3)].pjd.toNum)+sum(taskInfoListM.nums[(4)].pjd.toNum)+sum(taskInfoListM.nums[(5)].pjd.toNum) +sum(taskInfoListM.nums[(6)].pjd.toNum) +sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum) +sum(taskInfoListM.nums[(0)].tk.toNum) +sum(taskInfoListM.nums[(1)].tk.toNum)+sum(taskInfoListM.nums[(2)].tk.toNum)+sum(taskInfoListM.nums[(3)].tk.toNum)+sum(taskInfoListM.nums[(4)].tk.toNum)+sum(taskInfoListM.nums[(5)].tk.toNum) +sum(taskInfoListM.nums[(6)].tk.toNum))}}</span>
          预计本金:
          <span style="padding: 0 5px"> {{yjMoney = (sum(taskInfoListM.nums[(0)].yj.toNum) +sum(taskInfoListM.nums[(1)].yj.toNum)+sum(taskInfoListM.nums[(2)].yj.toNum)+sum(taskInfoListM.nums[(3)].yj.toNum)+sum(taskInfoListM.nums[(4)].yj.toNum)+sum(taskInfoListM.nums[(5)].yj.toNum) +sum(taskInfoListM.nums[(6)].yj.toNum) + sum(taskInfoListM.nums[(0)].pjd.toNum) +sum(taskInfoListM.nums[(1)].pjd.toNum)+sum(taskInfoListM.nums[(2)].pjd.toNum)+sum(taskInfoListM.nums[(3)].pjd.toNum)+sum(taskInfoListM.nums[(4)].pjd.toNum)+sum(taskInfoListM.nums[(5)].pjd.toNum) +sum(taskInfoListM.nums[(6)].pjd.toNum) ) * taskInfoListM.money +(sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+ sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum))* taskInfoListM.money2}}</span>
          预计佣金:
          <span style="padding: 0 5px"> {{yjComMoney =(sum(taskInfoListM.nums[(0)].yj.toNum) +sum(taskInfoListM.nums[(1)].yj.toNum)+sum(taskInfoListM.nums[(2)].yj.toNum)+sum(taskInfoListM.nums[(3)].yj.toNum)+sum(taskInfoListM.nums[(4)].yj.toNum)+sum(taskInfoListM.nums[(5)].yj.toNum) +sum(taskInfoListM.nums[(6)].yj.toNum) + sum(taskInfoListM.nums[(0)].pjd.toNum) +sum(taskInfoListM.nums[(1)].pjd.toNum)+sum(taskInfoListM.nums[(2)].pjd.toNum)+sum(taskInfoListM.nums[(3)].pjd.toNum)+sum(taskInfoListM.nums[(4)].pjd.toNum)+sum(taskInfoListM.nums[(5)].pjd.toNum) +sum(taskInfoListM.nums[(6)].pjd.toNum) +sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum))*5 +sum(taskInfoListM.nums[(0)].tk.toNum) +sum(taskInfoListM.nums[(1)].tk.toNum)+sum(taskInfoListM.nums[(2)].tk.toNum)+sum(taskInfoListM.nums[(3)].tk.toNum)+sum(taskInfoListM.nums[(4)].tk.toNum)+sum(taskInfoListM.nums[(5)].tk.toNum) +sum(taskInfoListM.nums[(6)].tk.toNum) * 10}}</span>
          坑值:
          <span style="padding: 0 5px">{{(kz = sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum)) * (taskInfoListM.money - taskInfoListM.money2)}}</span>
          人客单价:
          <span style="padding: 0 5px"> {{((sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum)) * (taskInfoListM.money - taskInfoListM.money2)) / zdNum}}</span>
          件客单件:
          <span style="padding: 0 5px"> {{((sum(taskInfoListM.nums[(0)].yhq.toNum) +sum(taskInfoListM.nums[(1)].yhq.toNum)+sum(taskInfoListM.nums[(2)].yhq.toNum)+sum(taskInfoListM.nums[(3)].yhq.toNum)+sum(taskInfoListM.nums[(4)].yhq.toNum)+sum(taskInfoListM.nums[(5)].yhq.toNum) +sum(taskInfoListM.nums[(6)].yhq.toNum)) * (taskInfoListM.money - taskInfoListM.money2)) / (sum(taskInfoListM.nums[(0)].tk.toNum) + sum(taskInfoListM.nums[(1)].tk.toNum)+sum(taskInfoListM.nums[(2)].tk.toNum) + sum(taskInfoListM.nums[(3)].tk.toNum)+sum(taskInfoListM.nums[(4)].tk.toNum)+sum(taskInfoListM.nums[(5)].tk.toNum) + sum(taskInfoListM.nums[(6)].tk.toNum)) / taskInfoListM.tknum}}</span>
        </el-row>
        <el-row class="three">
          <el-checkbox label=""
                       v-model="taskInfoListM.tz">
            是否0点停止
          </el-checkbox>
          <el-checkbox label=""
                       v-model="taskInfoListM.zdtz"
                       :disabled="taskInfoListM.dgjc">
            是否自动跳组
          </el-checkbox>

          <el-checkbox label=""
                       v-model="taskInfoListM.xnwl">
            是否发虚拟物流
          </el-checkbox>
          <el-checkbox label=""
                       v-model="taskInfoListM.ljsh">
            宣速发货后立即五分好评不带字
          </el-checkbox>
          <el-radio label="1"
                    v-model="taskInfoListM.yx">
            每天按照默认设置运行
          </el-radio>
          <el-radio label="2"
                    v-model="taskInfoListM.yx"
                    disabled>
            每天按照每日自定义计划运行
          </el-radio>
          <el-radio label="3"
                    v-model="taskInfoListM.yx">
            每天按照每日自定义计划运行(某日未设置按照默认设置运行)
          </el-radio>
          <el-checkbox label=""
                       v-model="taskInfoListM.dgjc"
                       @change="dgjcChange">多组优惠券
          </el-checkbox>
        </el-row>
        <el-row class="three">
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.sf1">排除黑号
            </el-checkbox>
            <el-input style="width: 50px"
                      v-model="taskInfoListM.input1"
                      size="mini">
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.sf3">信用绝对在2心以上
            </el-checkbox>
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.nl">理论20岁以上
            </el-checkbox>
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.sf4">账号注册时间满一年
            </el-checkbox>
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.courier">自动发真实快递
            </el-checkbox>

          </el-form-item>

          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.sf2">高权重单
            </el-checkbox>

          </el-form-item>
          <el-form-item label="日权重单占有率设置:"
                        size="mini"
                        label-width="150px">
            <el-input style="width: 50px"
                      v-model="taskInfoListM.qz">
            </el-input>
            %
          </el-form-item>
        </el-row>
        <el-row class="four">
          <el-form-item>
            <span>时间</span>
            <el-date-picker style="width:140px;"
                            placeholder="选择日期"
                            size="mini"
                            type="date"
                            :picker-options="pickerOptions1"
                            value-format="timestamp"
                            v-model="taskInfoListM.time">
            </el-date-picker>
          </el-form-item>
          <el-form-item>
            <span>提示</span>
            <el-input style="width: 250px"
                      v-model="taskInfoListM.tips"
                      size="mini">
            </el-input>
          </el-form-item>
          <el-form-item>
            <span>活动渠道</span>
            <select class="adminTask_select"
                    name=""
                    v-model="taskInfoListM.group"
                    style="width: 175px;"
                    @focus="isUp=true"
                    @blur="isUp=false">
              <option :value="item.value"
                      :label="item.label"
                      :key="item.label"
                      v-for="item in groups">
              </option>
            </select>
            <i class="select_up"
               :class="{'rotateUp':isUp}"></i>
          </el-form-item>
          <el-form-item>
            <span>每月首次加追加评价单数</span>
            <el-input style="width: 70px"
                      v-model="taskInfoListM.pjdNum"
                      size="mini">
            </el-input>
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.iszjtime">追加时间
            </el-checkbox>
            <el-time-picker v-model="taskInfoListM.zjtime"
                            :picker-options="{
                selectableRange: '00:00:00 - 23:59:00',
                 start: '10:00',
              }"
                            placeholder="任意时间点">
            </el-time-picker>

          </el-form-item>
          <el-form-item>
            <span>可用评价数</span>
            {{taskInfoListM.kynum}}
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.hb">花呗接单
            </el-checkbox>
          </el-form-item>
          <el-form-item>
            <el-checkbox label=""
                         v-model="taskInfoListM.spd">优先视频
            </el-checkbox>
          </el-form-item>
        </el-row>
        <el-form-item>
          <span>请选择关键词数：</span>
          <el-select size="mini"
                     v-model="taskNum">
            <el-option v-for="item in taskOption"
                       :key="item.taskNum"
                       :label="item.label"
                       :value="item.taskNum">
            </el-option>
          </el-select>
        </el-form-item>
        <!-- <el-form-item label=""
                        size="mini">
            <el-checkbox label=""
                         v-model="taskInfoListM.sf5">信誉积分</el-checkbox>
            <el-input-number v-model="taskInfoListM.num2"
                             :min="0"></el-input-number>至
            <el-input-number v-model="taskInfoListM.num3"
                             :min="1"></el-input-number>
          </el-form-item> -->

        <el-form-item>

          <el-form-item>
            <i class="select_up"
               :class="{'rotateUp':isUp}"></i>
            <el-checkbox label=""
                         v-model="taskInfoListM.scjg">
              原价单使用货比三家
            </el-checkbox>
          </el-form-item>
          <el-form-item>
            <span>每日追加评价数量</span>
            <el-input size="mini"
                      v-model="taskInfoListM.zpNum"
                      style="width:70px;">
            </el-input>
          </el-form-item>
          <span>重复率</span>
          <el-input-number v-model="taskInfoListM.repeat"
                           :controls="false"
                           :step="1"
                           size="mini"
                           :min="10"
                           :max="30"
                           style="width:50px;"></el-input-number>
          <el-checkbox label=""
                       v-model="taskInfoListM.bdyx">
            冰点营销
          </el-checkbox>

          <el-form-item>
            <el-checkbox label=""
                         disabled
                         v-model="taskInfoListM.zcsjx">
            </el-checkbox>
            <span>限制用户注册时间在</span>
            <el-date-picker placeholder="选择日期"
                            size="mini"
                            type="date"
                            value-format="timestamp"
                            v-model="taskInfoListM.zcsj">
            </el-date-picker>
            之后
            <el-checkbox label=""
                         v-model="taskInfoListM.zpdx">
            </el-checkbox>
            爆款运营链接排行数据
            <span>账号周拍的单小于</span>
            <el-input-number v-model="taskInfoListM.zpd"
                             :controls="false"
                             :step="1"
                             size="mini"
                             :min="0"
                             :max="5"
                             style="width:50px;"></el-input-number>
            <el-checkbox label=""
                         v-model="taskInfoListM.ypdx">
            </el-checkbox>
            <span>账号月拍的单小于</span>
            <el-input-number v-model="taskInfoListM.ypd"
                             :controls="false"
                             :step="1"
                             size="mini"
                             :min="0"
                             :max="25"
                             style="width:50px;"></el-input-number>
            <span>昨日搜索量</span>
            <el-input-number v-model="taskInfoListM.rqz"
                             :controls="false"
                             :step="1"
                             size="mini"
                             :min="0"
                             :max="1000000"
                             style="width:150px;"></el-input-number>
            <!-- </el-form-item>-->
            <el-form-item label-width="150px"
                          label="客单价在:"
                          size="mini">
              <el-input style="width: 50px"
                        v-model="taskInfoListM.kdj">
              </el-input>
              以上
            </el-form-item>

          </el-form-item>
          <!-- <el-form-item>
                            <el-select placeholder="请选择" size="mini" v-model="taskInfoListM.m" @change="templateChange">
                                <el-option v-for="item in templateList" :key="item.name" :label="item.name" :value="item.name">
                                </el-option>
                            </el-select>
                            <el-button type="primary" size="mini" @click="saveTemplate()">保存模板</el-button>
                        </el-form-item> -->
        </el-form-item>
        <el-form-item>
          每日计划：
          <el-button-group>

            <el-button size="medium"
                       :type="'默认' == activeDate? 'primary':''"
                       @click="activeDay('默认')">默认1
            </el-button>
            <el-button size="medium"
                       :type="'默认2' == activeDate? 'primary':''"
                       @click="activeDay('默认2')">
              默认2
            </el-button>
            <el-button :type="i == activeDate ? 'primary':''"
                       v-for="(i,index) in dayNum"
                       :key="index"
                       size="medium"
                       style="width:50px;text-align:center;"
                       @click="activeDay(i)">{{i}}
            </el-button>
            <el-button size="medium"
                       type="text"
                       style="width: 170px">评 价 数
            </el-button>
            <el-button type="text"
                       v-for="i in 31"
                       :key="i.id"
                       size="medium"
                       style="width:50px;text-align:center;">{{linkDayNum[i] ? linkDayNum[i] :0}}
            </el-button>

          </el-button-group>
        </el-form-item>
        <!-- <div style="position: relative;top: -125px;left: 53%">
                    <el-form-item label="激活组" style="position: relative;">
                        <el-select v-model="taskInfoListM.group" style="width: 175px;" size="mini">
                            <el-option v-for="item in groups" :key="item.label" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>

                </div> -->

        <div style="display:flex;">
          <div style="width:180px">
            <span>运行状态：</span>
            <el-button type="primary">
              运行中
            </el-button>
          </div>
          <!-- <el-button @click="addTaskM" type="primary">
                        确定
                    </el-button> -->
          <div style="flex:1;display: flex;justify-content: center;
                       margin-left: -186px;">
            <el-button @click="updateTask"
                       type="primary">
              更新
            </el-button>
            <el-button @click="setDefaultTemplate"
                       type="primary">
              保存
            </el-button>
            <el-button @click="dialogTask1 = false">
              取消
            </el-button>
            <!--<el-button>
                            评价库
                        </el-button>-->
          </div>
        </div>
        <!-- <el-form-item label="师傅佣金">
                     <el-input auto-complete="off" v-model="taskInfoList.teacherMoney" disabled></el-input>
                 </el-form-item>

                 <el-form-item label="佣金">
                     <el-input auto-complete="off" v-model="taskInfoList.comMoney" disabled></el-input>
                 </el-form-item>-->
        <div class="blcok"
             v-for="g in +taskNum"
             :key="g.id">

          <!-- <el-form-item label="" size="mini" style="position: relative;top: 25px"
                    >
                        <span @click="toUrl(taskInfoListM.keywords[(g-1)].keyword)">关键词{{g}}</span>
                        <el-input style="width: 190px" v-model="taskInfoListM.keywords[(g-1)].keyword">l
                        </el-input>
                    </el-form-item> -->
          <el-form-item label=""
                        size="mini"
                        class="keywordsVal">
            <!-- <span style="color:lightcoral;">*</span> -->
            <span @click="toUrl(taskInfoListM.keywords[(g-1)].keyword)">关键词{{g}}</span>
            <el-input style="width: 190px"
                      v-model="taskInfoListM.keywords[(g-1)].keyword">
            </el-input>
          </el-form-item>
          <el-form-item>
            <div class="tbb">
              <div style="width:51.5px;float: left;"
                   v-for="(i,index) in 24"
                   :key="index">
                {{i-1}}
              </div>
            </div>
            <el-form-item label="总原价单">
              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum(taskInfoListM.nums[(g-1)].yj.toNum)">
              </el-input>
              <!-- <div style="width: 52px">{{taskInfoListM.nums[(g-1)].yj.toNum | sum}}</div>-->
              <!--    <el-form-item label="需求单数" style="position: relative;left: 18px;">
                                    <el-input size="mini" style="width: 52px;"
                                              v-model="taskInfoListM.nums[(g-1)].yj.toNumX">
                                    </el-input>
                                </el-form-item>-->
              <el-form-item label=""
                            style="position: relative;width: 140px">
              </el-form-item>
              <el-form-item label="原价单">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          :disabled="(i-1) >1 && (i-1) <7 "
                          v-model="taskInfoListM.nums[(g-1)].yj.toNum[i-1]">
                </el-input>
              </el-form-item>
            </el-form-item>
            <br/>
            <el-form-item label="总评价单">
              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum(taskInfoListM.nums[(g-1)].pjd.toNum )">
              </el-input>
              <el-form-item label=""
                            style="position: relative;width: 140px">
              </el-form-item>

              <el-form-item label="评价单"
                            v-if="ss.pjd">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          :disabled="(i-1) >1 && (i-1) <7 "
                          v-model="taskInfoListM.nums[(g-1)].pjd.toNum[i-1]">
                </el-input>
              </el-form-item>
            </el-form-item>
            <br/>
            <el-form-item label="总优惠券单">
              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum(taskInfoListM.nums[(g-1)].yhq.toNum )">
              </el-input>
              <el-form-item label=""
                            style="position: relative;width: 140px">
              </el-form-item>
              <el-form-item label="优惠券单"
                            v-if="ss.yhjd">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          @change="taskInfoListM.sf2=false"
                          v-model="taskInfoListM.nums[(g-1)].yhq.toNum[i-1]">
                  <!--:disabled="(i-1) <7 "-->
                </el-input>
              </el-form-item>
            </el-form-item>
            <el-form-item label="总退款单"
                          v-if="taskInfoListM.tkd">
              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum (taskInfoListM.nums[(g-1)].tk.toNum )">
              </el-input>
              <el-form-item label=""
                            style="position: relative;width: 140px">
              </el-form-item>

              <el-form-item label="退款单">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          :disabled="(i-1) >1 && (i-1) <7 "
                          v-model="taskInfoListM.nums[(g-1)].tk.toNum[i-1]">
                </el-input>
              </el-form-item>
              <!-- <br/>
                             <div style="height: 30px">
                             </div>-->
            </el-form-item>
            <br v-if="taskInfoListM.gyd"/>
            <el-form-item label="总高佣单"
                          v-if="taskInfoListM.gyd">

              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum (taskInfoListM.nums[(g-1)].gy.toNum )">
              </el-input>
              <el-form-item label=""
                            style="position: relative;width: 140px">
              </el-form-item>
              <el-form-item label="高佣单">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          :disabled="i >20 || i<6"
                          v-model="taskInfoListM.nums[(g-1)].gy.toNum[i-1]">
                </el-input>
              </el-form-item>
              <br/>
              <div style="height: 30px">
              </div>
            </el-form-item>
            <br/>
            <el-form-item label="总搜索单">
              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum (taskInfoListM.nums[(g-1)].gy.toNum )">
              </el-input>
              <el-form-item label=""
                            style="position: relative;width: 50px">

              </el-form-item>
              <el-form-item label=""
                            style="position: relative;width: 76px">
                <!-- <el-input size="mini"
                          style="width: 110px;"
                          placeholder="宝贝id1"
                          v-model="taskInfoListM.ssdbabyid1">
                </el-input> -->
              </el-form-item>
              <!-- <el-form-item label="搜索单1">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          v-model="taskInfoListM.nums[(g-1)].gy.toNum[i-1]">
                </el-input>
              </el-form-item> -->
              <br/>

              <el-form-item label=""
                            style="position: relative;width: 105px">

              </el-form-item>
              <!-- <el-form-item label=""
                            style="position: relative;width: 76px">
                <el-input size="mini"
                          style="width: 110px;"
                          placeholder="宝贝id2"
                          v-model="taskInfoListM.ssdbabyid1">
                </el-input>
              </el-form-item> -->
              <!-- <el-form-item label="搜索单2">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          v-model="taskInfoListM.nums[(g-1)].gy.toNum[i-1]">
                </el-input>
              </el-form-item> -->
              <br/>
              <el-form-item label=""
                            style="position: relative;width: 105px">

              </el-form-item>
              <el-form-item label=""
                            style="position: relative;width: 76px">
                <!-- <el-input size="mini"
                          style="width: 110px;"
                          placeholder="宝贝id3"
                          v-model="taskInfoListM.ssdbabyid1">
                </el-input> -->
              </el-form-item>

              <!-- <el-form-item label="搜索单3">
                <el-input size="mini"
                          style="width: 52px;"
                          v-for="i in 24"
                          :key="i"
                          v-model="taskInfoListM.nums[(g-1)].gy.toNum[i-1]">
                </el-input>
              </el-form-item> -->
              <div style="height: 30px">
              </div>
            </el-form-item>
            <br/>
            <el-form-item label="总单数"
                          style="color: red;position: relative;top: -65px">
              <el-input size="mini"
                        style="width: 52px;"
                        :value="sum(taskInfoListM.nums[(g-1)].tk.toNum)  + sum(taskInfoListM.nums[(g-1)].yj.toNum) + sum(taskInfoListM.nums[(g-1)].pjd.toNum)  + sum(taskInfoListM.nums[(g-1)].yhq.toNum)">
              </el-input>
            </el-form-item>

            <el-form-item label=""
                          style="color: red;position: relative;top: -90px">
              <el-radio label="综合排序"
                        v-model="taskInfoListM.nums[(g-1)].sort">
                综合
              </el-radio>
              <el-radio label="销量排序:"
                        v-model="taskInfoListM.nums[(g-1)].sort">
                销量
              </el-radio>
              <!-- <el-radio v-model="taskInfoList.sort" label="价格排序">价格</el-radio>
                             <el-radio v-model="taskInfoList.sort" label="新品排序">新品</el-radio>-->
            </el-form-item>
            <el-form-item style="color: red;position: relative;top: -170px;left: -158px">
              <el-radio v-model="taskInfoListM.nums[(g-1)].goods2money"
                        label="货到付款">货到付款
              </el-radio>
            </el-form-item>
            <el-form-item style="color: red;position: relative;top: -145px;left: -252px">
              <el-radio v-model="taskInfoListM.nums[(g-1)].goods2money"
                        label="公益宝贝">公益宝贝
              </el-radio>
            </el-form-item>
            <el-form-item style="color: red;position: relative;top: -118px;left: -345px">
              <el-radio v-model="taskInfoListM.nums[(g-1)].goods2money"
                        label="无">无
              </el-radio>
            </el-form-item>

            <el-form style="position: relative;top: -48px;left: 255px"
                     v-if="taskInfoListM.gyd">
              <el-checkbox-group v-model="taskInfoListM.nums[(g-1)].enemy">
                <el-checkbox label="高佣单">
                  高佣单
                </el-checkbox>
              </el-checkbox-group>
            </el-form>

            <el-form-item label="对手宝贝ID1"
                          style="position: relative;top: -75px;left: 345px"
                          v-if="taskInfoListM.gyd">
              <el-input size="mini"
                        style="width: 118px;"
                        v-model="taskInfoListM.nums[(g-1)].babyId1">
              </el-input>
            </el-form-item>
            <el-form-item label="对手店铺名1"
                          style="position: relative;top: -75px;left: 345px"
                          label-width="90px"
                          v-if="taskInfoListM.gyd">
              <el-input size="mini"
                        style="width: 118px;"
                        v-model="taskInfoListM.nums[(g-1)].shop1">
              </el-input>
            </el-form-item>
            <el-form-item label="对手主图1"
                          style="position: relative;top: -75px;left: 345px"
                          label-width="80px"
                          v-if="taskInfoListM.gyd">
              <el-input size="mini"
                        style="width: 118px;"
                        v-model="taskInfoListM.nums[(g-1)].img1">
              </el-input>
            </el-form-item>
            <br/>

            <el-form-item label="对手宝贝ID2"
                          style="position: relative;top: -75px;left: 345px"
                          v-if="taskInfoListM.gyd">
              <el-input size="mini"
                        style="width: 118px;"
                        v-model="taskInfoListM.nums[(g-1)].babyId2">
              </el-input>
            </el-form-item>
            <el-form-item label="对手店铺名2"
                          style="position: relative;top: -75px;left:345px"
                          label-width="90px"
                          v-if="taskInfoListM.gyd">
              <el-input size="mini"
                        style="width: 118px;"
                        v-model="taskInfoListM.nums[(g-1)].shop2">
              </el-input>
            </el-form-item>
            <el-form-item label="对手主图2"
                          style="position: relative;top: -75px;left: 345px"
                          label-width="80px"
                          v-if="taskInfoListM.gyd">
              <el-input size="mini"
                        style="width: 118px;"
                        v-model="taskInfoListM.nums[(g-1)].img2">
              </el-input>
            </el-form-item>

            <!--<div>
                            sdsd
                        </div>-->

            <div v-if="taskInfoListM.dgjc">
              <el-form style="position: relative;top: -68px;left: 335px">
                <select class="adminTask_select"
                        name=""
                        v-model="taskInfoListM.dgjcgroup1"
                        style="width: 75px;"
                        @focus="isUp=true"
                        @blur="isUp=false">
                  <option :value="item.value"
                          :label="item.label"
                          :key="item.label"
                          v-for="item in groups2"></option>
                </select>
                <el-form-item label="">

                  <el-input size="mini"
                            style="width: 52px;"
                            v-for="i in 24"
                            :key="i"
                            v-model="taskInfoListM.nums[(g-1)].dgjc1.toNum[i-1]">
                    <!--:disabled=" (i-1) <7 "-->
                  </el-input>
                </el-form-item>
              </el-form>
              <el-form style="position: relative;top: -68px;left: 335px">
                <select class="adminTask_select"
                        name=""
                        v-model="taskInfoListM.dgjcgroup2"
                        style="width: 75px;"
                        @focus="isUp=true"
                        @blur="isUp=false">
                  <option :value="item.value"
                          :label="item.label"
                          :key="item.label"
                          v-for="item in groups2"></option>
                </select>
                <el-form-item label="">

                  <el-input size="mini"
                            style="width: 52px;"
                            v-for="i in 24"
                            :key="i"
                            v-model="taskInfoListM.nums[(g-1)].dgjc2.toNum[i-1]">
                    <!--:disabled=" (i-1) <7 "-->
                  </el-input>
                </el-form-item>
              </el-form>
              <el-form style="position: relative;top: -68px;left: 335px">

                <select class="adminTask_select"
                        name=""
                        v-model="taskInfoListM.dgjcgroup3"
                        style="width: 75px;"
                        @focus="isUp=true"
                        @blur="isUp=false">
                  <option :value="item.value"
                          :label="item.label"
                          :key="item.label"
                          v-for="item in groups2"></option>
                </select>
                <el-form-item label="">

                  <el-input size="mini"
                            style="width: 52px;"
                            v-for="i in 24"
                            :key="i"
                            :disabled="(i-1) <7 "
                            v-model="taskInfoListM.nums[(g-1)].dgjc3.toNum[i-1]">
                  </el-input>
                </el-form-item>
              </el-form>
            </div>
            <!--<el-form-item label="" style="color: red;position: relative;top: -18px">
                            <el-checkbox-group v-model="taskInfoListM.nums[(g-1)].goods2money">
                                <el-checkbox label="公益宝贝">
                                    公益宝贝
                                </el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="" style="color: red;position: relative;top: -18px">
                            <el-checkbox-group v-model="taskInfoListM.nums[(g-1)].goods2money">
                                <el-checkbox label="货到付款">
                                    货到付款
                                </el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>-->
          </el-form-item>
        </div>
      </el-form>
      <div class="dialog-footer"
           slot="footer"
           style="position: relative;left: 749.5px">
        <el-button @click="setDefaultTemplate('form')"
                   type="primary">
          保存
        </el-button>

        <el-button @click="addTaskM"
                   type="primary">
          确 定
        </el-button>

        <el-button @click="dialogTask1 = false">
          取 消
        </el-button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="dialogTask3">
      <template>
        <div class="block"
             style="margin:10px;">
          <span class="demonstration">选择日期区间 </span>
          <el-date-picker v-model="lineDate"
                          type="daterange"
                          align="right"
                          unlink-panels
                          range-separator="至"
                          start-placeholder="开始日期"
                          end-placeholder="结束日期"
                          :picker-options="pickerOptions2"
                          size="small"
                          value-format="timestamp">
          </el-date-picker>
          <el-button type="primary"
                     @click="getLine(lineType,lineBabyId,lineBabyName);"
                     size="small">
            确定
          </el-button>
        </div>
      </template>
      <div id="charts"
           style="height:500px;margin: 20px 20px 0 20px"></div>
    </el-dialog>
    <el-dialog :visible.sync="chengbendia"
               custom-class="chengbendia">
      <el-form :inline="true">
        <el-form-item label="一件成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.cb1"
                    style="width: 150px"></el-input>
        </el-form-item>
        <el-form-item label="一件快递打包纸箱成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.cbkd1"
                    style="width: 150px"></el-input>
        </el-form-item>
        <el-form-item label="两件成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.cb2"
                    style="width: 150px"></el-input>
        </el-form-item>
        <el-form-item label="两件快递打包纸箱成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.cbkd2"
                    style="width: 150px"></el-input>
        </el-form-item>

        <el-form-item label="三件成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.cb3"
                    style="width: 150px"></el-input>
        </el-form-item>

        <el-form-item label="三件快递打包纸箱成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.cbkd3"
                    style="width: 150px"></el-input>
        </el-form-item>
        <el-form-item label="过滤价格">
          <el-input placeholder="请输入内容"
                    v-model="lr.gl1"
                    style="width: 180px"></el-input>
        </el-form-item>
        <el-form-item label="--">
          <el-input placeholder="请输入内容"
                    v-model="lr.gl2"
                    style="width: 180px"></el-input>
        </el-form-item>

        <el-form-item label="总提成">
          <el-input placeholder="请输入内容"
                    v-model="lr.ztc"
                    style="width: 70px"></el-input>
        </el-form-item>
        <el-form-item label="运营提成">
          <el-input placeholder="请输入内容"
                    v-model="lr.yytc"
                    style="width: 70px"></el-input>
        </el-form-item>
        <el-form-item label="美工提成">
          <el-input placeholder="请输入内容"
                    v-model="lr.mgtc"
                    style="width: 70px"></el-input>
        </el-form-item>
        <el-form-item label="助理提成">
          <el-input placeholder="请输入内容"
                    v-model="lr.zltc"
                    style="width: 70px"></el-input>
        </el-form-item>
        <el-form-item label="其他总成本">
          <el-input placeholder="请输入内容"
                    v-model="lr.qtcb"
                    style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="每日开销">
          <el-input placeholder="请输入内容"
                    v-model="lr.kx"
                    style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="月份">
          <el-button-group>
            <el-button v-for="(i,index) in 12"
                       :key="index"
                       size="mini"
                       style="width:58px;text-align:center;">{{i}}
            </el-button>
          </el-button-group>
        </el-form-item>
        <el-form-item label="提成">
          <el-input style="width: 57px"
                    v-model="tc[i]"
                    v-for="(i,index) in 12"
                    :key="index"
                    size="mini">
          </el-input>
        </el-form-item>

        <el-form-item style="float: right">
          <el-button size="small"
                     type="primary"
                     @click="upLr">确认
          </el-button>
        </el-form-item>
        <br/>
        <br/>
        <br/>
        <br/>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        wangwang: "",
        pickerOptions1: {
          disabledDate(time) {
            return time.getTime() < Date.now() - 8.64e7;
          },
        },
        tableData: [],
        searchs: [
          {
            value: "shop",
            label: "店铺名"
          },
          {
            value: "babyId",
            label: "宝贝ID"
          },
          {
            value: "user",
            label: "发布用户"
          }
        ],
        searchList: {
          search: "shop",
          searchValue: "",
          filter: {
            user: "",
            taskStatus: ""
          },
          pn: 1,
          total: 0
        },

        ss: {
          tk: false,
          pjd: false,
          yhjd: false
        },

        gs: "0",
        cooperate: {
          data: [],
          profit: {}
        },
        pickerOptions2: {
          shortcuts: [
            {
              text: "最近一周",
              onClick(picker) {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                picker.$emit("pick", [start, end]);
              }
            },
            {
              text: "最近一个月",
              onClick(picker) {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                picker.$emit("pick", [start, end]);
              }
            },
            {
              text: "最近三个月",
              onClick(picker) {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                picker.$emit("pick", [start, end]);
              }
            }
          ]
        },
        value4: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
        value5: "",
        cpData: [],
        xprData: [],
        yjjc: 0,
        checked: true,
        yhqzt: false,
        groupNum: [],
        isShowMoney: false,

        tc: [],
        activeBtn: "0",
        currentId: 0,
        currentNum: "",
        comparerKeywords: "",
        comparerLink: "",
        operationDate: "", //运营排行榜时间
        personObj: {},
        InsuranceTIp: false,
        linkDayNum: {},
        defaultValue: true,
        everyPerson: [],
        mgtableData: [],
        totalMl: 0,
        totalJl: 0,
        totalSum: 0,
        lr: {
          kx: 0,
          cb1: 10,
          cbkd1: 3.6,
          cb2: 22,
          cbkd2: 3.6,
          cb3: 35,
          cbkd3: 4.6,
          gl1: 1,
          gl2: 27,
          ztc: "2%",
          yytc: "80%",
          mgtc: "10%",
          qtcb: 0,
          zltc: "10%",
          tc: []
        },
        lrTemp: {
          kx: 0,
          cb1: 10,
          cbkd1: 3.6,
          cb2: 22,
          cbkd2: 3.6,
          cb3: 35,
          cbkd3: 4.6,
          gl1: 1,
          gl2: 27,
          ztc: "2%",
          yytc: "80%",
          mgtc: "10%",
          qtcb: 0,
          zltc: "10%",
          tc: []
        },
        chengbendia: false,
        yjComMoney: "",
        yjMoney: "",
        ranPersonAddTime: "",
        isUp: false,
        activeDate: "",
        dayNum: "",
        taskNum: "1",
        currentPerson: [],
        initArr: [],
        filterDefault: "",
        filterOptions: [
          {
            label: "s",
            value: "1"
          },
          {
            label: "公司",
            value: "0"
          }
        ],
        peopleOptions: [],
        taskOption: [
          {
            taskNum: "1",
            label: "1"
          },
          {
            taskNum: "2",
            label: "2"
          },
          {
            taskNum: "3",
            label: "3"
          },
          {
            taskNum: "4",
            label: "4"
          },
          {
            taskNum: "5",
            label: "5"
          },
          {
            taskNum: "6",
            label: "6"
          },
          {
            taskNum: "7",
            label: "7"
          }
        ],
        rules: {
          zy: [{required: true, message: "专员不能为空", trigger: "blur"}],
          czy: [{required: true, message: "操作员不能为空", trigger: "blur"}],
          mg: [{required: true, message: "美工不能为空", trigger: "blur"}],
          pjwhy: [
            {required: true, message: "评价维护员不能为空", trigger: "blur"}
          ],
          babyId: [
            {required: true, message: "宝贝ID不能为空", trigger: "blur"}
          ],
          shop: [{required: true, message: "店铺不能为空", trigger: "blur"}],
          money: [{required: true, message: "价格不能为空", trigger: "blur"}],
          babyName: [
            {required: true, message: "产品名称不能为空", trigger: "blur"},
            {min: 5, max: 8, message: "长度在 5 到 8 个字符", trigger: "blur"}
          ],
          tag: [{required: true, message: "类目不能为空", trigger: "blur"}],
          img: [{required: true, message: "图片地址不能为空", trigger: "blur"}]
        },
        //   ruleForm: {},
        groups: [
          {
            label: "B组",
            value: "b"
          },

          {
            label: "Z组",
            value: "b-1"
          },
          {
            label: "W组",
            value: "w"
          },
          {
            label: "F组",
            value: "f"
          },
          {
            label: "A组",
            value: "a"
          },
          {
            label: "A-1组",
            value: "A-1"
          }
        ],
        groups2: [
          {
            label: "无",
            value: "无"
          },
          {
            label: "B组",
            value: "b"
          },

          {
            label: "Z组",
            value: "b-1"
          },
          {
            label: "W组",
            value: "w"
          },
          {
            label: "F组",
            value: "f"
          },
          {
            label: "A组",
            value: "a"
          },
          {
            label: "A-1组",
            value: "A-1"
          }
        ],
        yx1: "1",
        initData: [
          {teacherMonth: 0},
          {teacherMonth: 100},
          {teacherMonth: 300}
        ],
        advancedSetting: 0,
        taskInfoListM: {
          sf2: false,
          rqz: 0,
          shopmoney: "", //产品搜索展示价格
          shopnum: 1, //购买件数
          qz: 30, //权重占有率
          sf1: true,
          num2: 0,
          num3: 30,
          input1: 5,
          zcsj: 0,
          repeat: 20,
          sex: "3",
          tips: "立即五分不带字好评！",
          yx: "1",
          zdtz: false,
          dgjcgroup1: "无",
          dgjcgroup2: "无",
          type: "超级爆款模式",
          zpNum: 0,
          sort: "综合排序",
          babyId: "",
          fid: "",
          pjyh: "",
          lv: 3,
          money2: 0,
          xnwl: false,
          yhtkl: false,
          ljsh: false,
          mr2: "",
          advancedSetting: false,
          keywords: [
            {
              keyword: ""
            },
            {
              keyword: ""
            },
            {
              keyword: ""
            },
            {
              keyword: ""
            },
            {
              keyword: ""
            },
            {
              keyword: ""
            },
            {
              keyword: ""
            }
          ],
          nums: [
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            },
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            },
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            },
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            },
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            },
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            },
            {
              sort: "综合排序",
              goods2money: "无",
              bNum: [],
              dgjc1: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc2: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              dgjc3: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              gy: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yj: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              tk: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              yhq: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              pjd: {
                toNum: [],
                toNumZ: "",
                toNumX: ""
              },
              bl: []
            }
          ]
        },
        dialogTask1: false,
        dialogTask2: false,
        dialogTask3: false,
        lineDate: [],
        lineData: [],
        lineBabyId: "",
        lineBabyName: "",
        lineType: "",
        lineList: [],
        addTaskType: "",
        input: "",
        RankingNum: {},
        UserRankingNum: {
          user: []
        },
        value1: "",
        value4: "",
        person: [],
        profitShow: false,
        profitData: {
          link: ""
        },
        UpImg: [],
        templateList: [],
        taskInfoListTemp: {
          type: "超级爆款模式",
          couponsCheck: false,
          couponsMoney: "",
          coupons: "",
          shop: "",
          babyId: "",
          money: "",
          principal: "",
          comMoney: "5",
          toNum: "",
          endNum: "0",
          theNum: "0",
          sort: "综合排序",
          teacherMoney: "2",
          goods2money: ["货到付款"],
          class: "普通",
          f: "自营",
          goodcomment2: false,
          keywords: {
            keywords1: "",
            toNum1: 0,
            keywords2: "",
            toNum2: 0,
            keywords3: "",
            toNum3: 0,
            keywords4: "",
            toNum4: 0
          }
        },
        loading: true,
        filterStatus: {
          user: false,
          task: false
        },
        taskInfoList: {
          couponsCheck: false,
          couponsMoney: "",
          coupons: "",
          shop: "",
          babyId: "",
          money: "",
          principal: "",
          comMoney: "5",
          toNum: "",
          endNum: "0",
          theNum: "0",
          sort: "综合排序",
          teacherMoney: "2",
          goods2money: ["货到付款"],
          class: "普通",
          goodcomment2: false,
          f: "自营",
          keywords: {
            keywords1: "",
            toNum1: 0,
            keywords2: "",
            toNum2: 0,
            keywords3: "",
            toNum3: 0,
            keywords4: "",
            toNum4: 0
          }
        },
        taskInfoListM2: {},
        zjOption: [],
        sjOption: [],
        zjMoney: 0,
        sjMoney: 0,
        yyph: "综合稳定模式",
        artData: [],
        zttaskH: 0,
        mMoney: 0,
        mNum: 0
      };
    },
    methods: {
      switchTaskStatus(a, b) {
        let title;
        let _this = this;
        a === 1
          ? (title = "确认任务 " + b + " 状态更新为暂停?")
          : (title = "确认任务 " + b + " 状态更新为正常?");
        _this
          .$confirm(title, "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning"
          })
          .then(() => {
            _this.$http
              .post("/api/api.php", {
                id: "updateTaskStatus",
                user: b,
                status: a
              })
              .then(function (response) {
                _this.$message({
                  type: response.data.status,
                  message: response.data.msg
                });
                _this.getTaskList();
              });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
          });
      },
      getShopList() {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "getShopList"
          })
          .then(function (response) {
            _this.tableData4 = response.data.data;
          });
      },
      getCommission() {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "getCommission"
          })
          .then(function (response) {
            // console.log(response)
            _this.commission = response.data.data;
            _this.xswl = response.data.xswl
            //_this.money = response.data.money;
          });
      },
      handleSelectionChange(val) {
        this.multipleSelection = val;
      },
      filter(value) {
        // console.log(value);
        value.filterUser
          ? (this.searchList.filter.user = value.filterUser[0])
          : (this.searchList.filter.taskStatus = value.filterTask[0]);
        this.getTaskList();
      },
      getTaskList() {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "getTaskList",
            search: JSON.stringify(_this.searchList)
          })
          .then(function (response) {
            _this.tableData = response.data.data;
            _this.searchList.total = parseInt(response.data.total);
            _this.loading = false
          });
      },
      resetList() {
        //   taskInfoList=taskInfoListTemp;
        this.$set(this, "taskInfoList", this.taskInfoListTemp);
      },
      yunyingRanking({row, rowIndex}) {
        if (rowIndex === 0) {
          return "purpleColour";
        } else if (rowIndex === 1) {
          return "yellowColour";
        } else if (rowIndex === 2) {
          return "orangeColour";
        }
        return "";
      },

      getLine(type, id, name) {
        this.lineData["type"] = type;
        this.lineBabyId = id;
        this.lineBabyName = name;
        if (this.lineDate[0] == this.lineDate[1]) {
          this.lineData["start_time"] = Math.round(this.lineDate[0] / 1000);
          this.lineData["end_time"] = "";
          this.lineData["unit"] = "hour";
        } else {
          this.lineData["start_time"] = Math.round(this.lineDate[0] / 1000);
          this.lineData["end_time"] = Math.round(this.lineDate[1] / 1000);
          this.lineData["unit"] = "day";
        }

        this.dialogTask3 = true;
        let _this = this;
        _this.$http
          .post("/api/statistics.php", {
            baby_id: _this.lineBabyId,
            start_time: _this.lineData["start_time"],
            end_time: _this.lineData["end_time"],
            unit: _this.lineData["unit"],
            type: _this.lineData["type"]
          })
          .then(function (response) {
            _this.lineList[0] = response.data.time;
            _this.lineList[1] = response.data.data;
            var echarts = require("echarts");
            var myChart = echarts.init(document.getElementById("echarts"));
            var option = {
              // 标题
              title: {
                text: _this.lineType == "s" ? "s单统计" : "实际销量统计",
                subtext: ""
              },
              tooltip: {
                trigger: "axis"
              },
              //图例名
              legend: {},
              grid: {
                left: "3%", //图表距边框的距离
                right: "4%",
                bottom: "3%",
                containLabel: true
              },
              //工具框，可以选择
              toolbox: {
                feature: {
                  saveAsImage: {}
                }
              },
              //x轴信息样式
              xAxis: {
                type: "category",
                boundaryGap: false,
                data: _this.lineList[0],
                //坐标轴颜色
                axisLine: {
                  lineStyle: {
                    color: "#000"
                  }
                },
                //x轴文字旋转
                axisLabel: {
                  rotate: 30,
                  interval: 0
                }
              },

              yAxis: [
                {
                  type: "value",
                  axisLabel: {
                    formatter: "{value} "
                  }
                }
              ],
              series: [
                {
                  name: _this.lineBabyName,
                  type: "line",
                  symbol: "circle",
                  symbolSize: 4,
                  itemStyle: {
                    normal: {
                      color: "red",
                      borderColor: "red" //拐点边框颜色
                    }
                  },
                  data: _this.lineList[1]
                }
              ]
            };
            myChart.setOption(option);
          });
      },
      getMMoney() {
        let _this = this;
        this.axios
          .post("/api/ranking.php", {
            id: "getMMoney"
          })
          .then(data => {
            console.log(data);
            this.mMoney = data.data.mMoney;
            this.mNum = data.data.yjNum + data.data.yhqNum;
          });
      },
      zttask(a) {
        let _this = this;
        this.axios
          .post("/cron/ztTask.php", {
            id: a,
            h: _this.zttaskH
          })
          .then(data => {
            _this.$message({
              message: "成功",
              type: "success"
            });
          });
      },
      yhqztChange(a) {
        if (a) {
          this.taskInfoListM.zdtz = false;
        } else {
          this.axios.post("/api/api.php").then(data => {
            console.log(data);
            this.groupNum = data.data;
          });
        }
      },
      getGroupNum() {
        this.axios.post("/api/getGroupNum.php").then(data => {
          console.log(data);
          this.groupNum = data.data;
        });
      },
      dgjcChange(a) {
        if (a) {
          this.taskInfoListM.zdtz = false;
        }
      },
      clickWangWang(a) {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "clickWangWang",
            wangwang: _this.wangwang
          })
          .then(function (response) {
            _this.$message({
              type: response.data.status,
              message: response.data.msg
            });
          });
      },
      getManager() {
        let d = new Date();
        let year = d.getFullYear();
        let month = d.getMonth() + 1;
        let date = d.getDate();
        month < 10 ? (month = "0" + month) : month;
        date < 10 ? (date = "0" + date) : date;
        this.operationDate = year + "-" + month + "-" + date;
        this.axios
          .post(
            "/api/getProfits.php?time=" +
            this.operationDate +
            "&type=" +
            this.yyph
          )
          .then(data => {
            const result = data.data;
            this.artData = result.mg;
            this.xprData = result.xpr;
            this.cpData = result.cp;
          });
      },
      changeShowMoney(item) {
        this.isShowMoney = !this.isShowMoney;
        let back = this.zjOption.slice();
        if (!item) {
          let result = back.filter(items => {
            if (items.zsmoney != 0) {
              return items;
            }
          });
          this.person = result;
        } else {
          this.person = back;
        }
      },
      yyphChange() {
        let d = new Date(this.value1);
        let year = d.getFullYear();
        let month = d.getMonth() + 1;
        let date = d.getDate();
        month < 10 ? (month = "0" + month) : month;
        date < 10 ? (date = "0" + date) : date;
        this.operationDate = year + "-" + month + "-" + date;
        let _this = this;

        this.axios
          .post(
            "/api/getProfits.php?time=" +
            this.operationDate +
            "&type=" +
            this.yyph
          )
          .then(data => {
            _this.everyPerson = [];
            let result = data.data;
            this.artData = result.mg;
            this.xprData = result.xpr;
            this.cpData = result.cp;
            _this.totalMl = result.data.ml;
            _this.totalJl = result.data.jl;
            _this.totalSum = result.data.zs;
            for (let key in result.users) {
              _this.everyPerson.push(
                Object.assign({}, result.users[key], {name: key})
              );
            }
            _this.everyPerson.sort(_this.descFun("ml"));
            _this.everyPerson[0].champiton = true;
            _this.everyPerson[1].second_place = true;
            _this.everyPerson[2].third_place = true;
            console.log(_this.everyPerson);
            this.everyPerson.forEach(item => {
              console.log(1232);
            });
          });
      },
      onRowClick(row, event, column) {
        let index = row.index;
        this.currentId = index;
        //   this.$set(row, "mr2", this.currentNum);
      },
      getcurrentId({row, rowIndex}) {
        row.index = rowIndex;
      },
      //   禁止选择之前的时间
      // disableBefore(time) {
      //   let beginTime = this.taskInfoListM.time;
      //   if (beginTime) {
      //     return time.getTime() < beginTime;
      //   }
      //   console.log(time);
      // },
      changeDate() {
        let d = new Date(this.value1);
        let year = d.getFullYear();
        let month = d.getMonth() + 1;
        let date = d.getDate();
        month < 10 ? (month = "0" + month) : month;
        date < 10 ? (date = "0" + date) : date;
        this.operationDate = year + "-" + month + "-" + date;
        let _this = this;
        this.axios
          .post(
            "/api/getProfits.php?time=" +
            this.operationDate +
            "&type=" +
            this.yyph
          )
          .then(data => {
            _this.everyPerson = [];
            let result = data.data;
            _this.artData = result.mg;
            _this.totalMl = result.data.ml;
            _this.totalJl = result.data.jl;
            _this.totalSum = result.data.zs;
            for (let key in result.users) {
              _this.everyPerson.push(
                Object.assign({}, result.users[key], {name: key})
              );
            }
            _this.everyPerson.sort(_this.descFun("ml"));
            _this.everyPerson[0].champiton = true;
            _this.everyPerson[1].second_place = true;
            _this.everyPerson[2].third_place = true;

            console.log(21321432);
            var yjjc = 0;
            this.everyPerson.forEach(item => {
              if (item.ymll) {
                yjjc += parseInt(item.ymll);
              }
            });
            console.log(yjjc);
            var num = yjjc;
            console.log(num, "ewqre");
            this.everyPerson.forEach(item => {
              item.yjjc = (parseInt(item.ymll) * 20000) / num;
            });
          });
      },

      sort(prop, order) {
        console.log(prop, order);
      },
      // 点击降序
      desc(column, event) {
        let option = this.whichOption(column.label);
        this.person.sort(this.descFun(option));
      },
      descOperation(column, event) {
        let option = this.whichOption2(column.label);
        this.everyPerson.sort(this.descFun(option));
        this.everyPerson[0].champiton = true;
        this.everyPerson[1].second_place = true;
        this.everyPerson[2].third_place = true;
        console.log(this.everyPerson);
      },
      // 降序算法
      descFun(obj) {
        let _this = this;
        return (a, b) => {
          let val1 = a[obj];
          let val2 = b[obj];
          return val2 - val1;
        };
      },
      whichOption2(label) {
        let title = {
          日毛利润: "ml",
          日净利润: "jl"
        };
        return title[label];
      },
      // 根据标签返回字段值
      whichOption(label) {
        let title = {
          日S单: "num",
          日实际额: "zsmoney",
          日实际单数: "zsnum",
          日本金: "money",
          预计金额: "yjMoney",
          已评数: "dayNum",
          预计刷单: "yjNum"
        };
        return title[label];
      },
      getCooperationProfitList() {
        let _this = this;
        _this.$http.get("/cron/sj.php", {}).then(function (response) {
          if (response) {
            console.log("getCooperationProfitList");

            _this.cooperate.data = response.data.data;
            _this.cooperate.profit = response.data.money;

            console.log(_this.cooperate);
          }
        });
      },
      //公司颜色
      shopColor(shop) {
        let color = {
          felee斐丽东科专卖店: "rgb(46,117,182)",
          felee斐丽悦影专卖店: "rgb(0,176,180)",
          felee斐丽私葵专卖店: "rgb(0,176,240)",
          lightstim宝萍专卖店: "rgb(244,176,130)",
          moxartisan东科专卖店: "rgb(192,146,0)",
          moxartisan宝萍专卖: "rgb(117,113,113)",
          东科化妆品专营店: "rgb(124,182,131)",
          丹锐旗舰店: "rgb(235,126,129)",
          乾朗医疗器械专营店: "#006400",
          傲禾家居专营店: "rgb(132,151,176)",
          养森企业厂家店: "#DAA520",
          创享生活成人用品专营店: "rgb(162,102,101)",
          千面仪人: "rgb(165,165,165)",
          博雅化妆品专营店: "rgb(251,189,19)",
          吉优电器专营: "rgb(243,84,16)",
          岁美化妆品专营: "#00CED1",
          岁美医疗器械专营店: "rgb(136,72,152)",
          悦影博雅专卖店: "rgb(224,58,121)",
          斐丽宝萍专卖店: "rgb(194,121,119)",
          斐丽旗舰店: "rgb(243,84,16)",
          斐丽艾格莎专卖店: "rgb(255,67,67)",
          植美村旗舰店: "rgb(248,203,172)",
          浩繁旗舰店: "rgb(255,208,101)",
          淘康家居专营店: "rgb(236,122,46)",
          猫叮儿: "rgb(196,231,89)",
          生命城堡旗舰店: "rgb(235,126,169)",
          生命城堡芙萱专卖店: "rgb(192,146,0)",
          私葵成人用品专营店: "rgb(243,84,26)",
          蓓俪芙養森厂家: "rgb(155,231,247)",
          蓓蓓养生馆: "rgb(124,182,131)",
          西米风家居专营店: "black",
          风清扬个人护理专营店: "rgb(251,159,19)"
        };
        return color[shop];
      },
      // 运营员颜色
      whichColor(person) {
        let color = {
          刘小程: "rgb(46,117,182)",
          刘红伍: "rgb(0,176,180)",
          刘红双: "rgb(0,176,240)",
          刘美君: "rgb(244,176,130)",
          孙小松运营专员: "rgb(192,146,0)",
          孟林炳运营专员: "rgb(117,113,113)",
          廖雄: "rgb(124,182,131)",
          曹璐斯: "rgb(235,126,129)",
          曾云云: "rgb(197,224,178)",
          李威: "rgb(132,151,176)",
          李湘翔: "rgb(243,84,26)",
          李祖湖: "rgb(162,102,101)",
          李静瑶: "rgb(165,165,165)",
          淘小三: "rgb(251,189,19)",
          王旺华: "rgb(243,84,16)",
          陈乐敏: "rgb(155,231,247)",
          黄茹烨: "rgb(192,146,0)",
          b: "rgb(162,102,101)",
          b: "rgb(165,165,165)",
          c: "rgb(251,189,19)",
          w: "rgb(162,102,101)",
          d: "rgb(124,182,131)",
          c: "rgb(244,176,130)",
          wd: "rgb(243,84,16)",
          "D-a": "rgb(243,84,16)",
          "D-b": "rgb(0,176,240)",
          "D-c": "rgb(192,146,0)"
        };
        return color[person];
      },
      upLr() {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "upLr",
            link: _this.taskInfoListM.babyId,
            data: JSON.stringify(_this.lr),
            tc: JSON.stringify(_this.tc)
          })
          .then(function (response) {
            _this.$message({
              type: "success",
              message: "成功"
            });
            _this.lr = _this.lrTemp;
          });
      },
      getLinkDayNum(a) {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "getLinkDayNum",
            link: a
          })
          .then(function (response) {
            if (response) {
              _this.linkDayNum = response.data.data;
              _this.taskInfoListM.kynum = response.data.num;
              console.log(response, 456);
            }
          });
      },
      toPoint(percent) {
        let str = percent.replace("%", "");
        str = str / 100;
        return str;
      },
      chengben(a) {
        this.chengbendia = true;
        if (a.type == "" || a.type == "超级爆款模式") {
          this.tc = [
            "1",
            "1",
            "0.8",
            "0.8",
            "0.8",
            "0.6",
            "0.6",
            "0.6",
            "0.6",
            "0.5",
            "0.5",
            "0.5",
            "0.5"
          ];
        } else {
          this.tc = [
            "1.5",
            "1.5",
            "1.3",
            "1.3",
            "1.3",
            "1.2",
            "1.2",
            "1.2",
            "1.2",
            "1",
            "1",
            "1",
            "1"
          ];
        }
      },
      filterData(event) {
        console.log(this.sjOption, this.zjOption);
        event == 1
          ? (this.person = this.sjOption)
          : (this.person = this.zjOption);
        this.gs = event;
      },
      filterData2(event) {
        this.person = this.initArr;
        let back = this.person.filter(item => {
          // console.log(item.person);
          return event == item.person;
        });
        this.person = back;
      },
      resetOption() {
        this.person = this.sjOption.concat(this.zjOption);
      },
      resetOption2() {
        this.person = this.initArr;
      },
      handleClick(row) {
        //   this.$router.push("/backup3/" + row.link);
      },
      expTrue(row) {
        this.$refs.userList.toggleRowExpansion(row);
      },
      saveTemplate() {
        let _this = this;
        this.$prompt("请输入模板名称", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消"
        })
          .then(({value}) => {
            console.log(value);
            console.log(JSON.stringify(_this.taskInfoListM));
            _this.$http
              .post("/api/api.php", {
                id: "addTemplate",
                data: JSON.stringify(_this.taskInfoListM),
                name: value
              })
              .then(function (response) {
                _this.$message({
                  type: response.data.status,
                  message: response.data.msg
                });
                //_this.taskInfoList.keywords = '';
                // _this.dialogTask = false;
                _this.getTaskList();
              });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "取消输入"
            });
          });
      },
      //申请奖励

      updateTask() {
        let _this = this;
        _this.$http
          .post("/api/api.php", {
            id: "updateTask",
            data: JSON.stringify(_this.taskInfoListM),
            type: _this.addTaskType
          })
          .then(function (response) {
            console.log(response.data.msg);
            if (response.data.msg) {
              _this.$message({
                type: response.data.status,
                message: response.data.msg
              });
            } else {
              _this.$message({
                type: response.data.status,
                message: "更新成功"
              });
            }
          });
      },
      addTaskM() {
        let msg = "";


        let _this = this;
        let keyword;
        for (let i in _this.taskInfoListM.keywords) {
          console.log(_this.taskInfoListM.keywords[i].keyword);
          keyword = _this.taskInfoListM.keywords[i].keyword;
          if (keyword.indexOf("€") != -1) {
            _this.$message({
              message: "关键词不能为淘口令",
              type: "error"
            });
            return;
          }
        }
        let sumPJd = 0;
        for (let i = 0; i < 7; i++) {
          if (Number(this.taskInfoListM.nums[i].pjd.toNum[0])) {
            sumPJd += Number(this.taskInfoListM.nums[i].pjd.toNum[0]);
          }
        }
        if (sumPJd < this.taskInfoListM.zpNum) {
          this.$message({
            type: "warning",
            message: "评价单数少于每日追加评价数量"
          });
          return;
        }
        this.$refs["form"].validate(valid => {
          if (valid) {
            _this.$http
              .post("/api/api2.php", {
                id: "addTask2",
                data: JSON.stringify(_this.taskInfoListM),
                type: _this.addTaskType,
                money: _this.yjMoney * 1 + _this.yjComMoney * 1
                /* BackupionChangea: JSON.stringify(_this.BackupionChangea)*/
              })
              .then(function (response) {
                console.log(response.data.msg);
                if (response.data.msg) {
                  _this.$message({
                    type: response.data.status,
                    message: response.data.msg
                  });
                } else {
                  _this.$message({
                    type: response.data.status,
                    message: "发布成功!"
                  });
                }

                //_this.taskInfoList.keywords = '';
                // _this.dialogTask = false;
                //   _this.getTaskList();
              });
          }
        });
        /*_this.BackupionChangea = [];*/
      },
      setDefaultTemplate(formName) {
        let _this = this;
        let index = "";
        let c = 0;
        if (
          this.taskInfoListM.group == "d" &&
          this.taskInfoListM.group == "d-1"
        ) {
          c = 1;
        }
        if (
          this.taskInfoListM.group == "b" &&
          this.taskInfoListM.group == "b-1"
        ) {
          c = 1;
        }
        if (
          this.taskInfoListM.group == "c" &&
          this.taskInfoListM.group == "c-1"
        ) {
          c = 1;
        }
        if (
          this.taskInfoListM.group == "w" &&
          this.taskInfoListM.group == "w-1"
        ) {
          c = 1;
        }
        if (c == 1) {
          _this.$message({
            message: "不能选择同一组",
            type: "error"
          });
          return;
        }

        if (this.activeDate == "默认") {
          index = 0;
        } else if (this.activeDate == "默认2") {
          index = 1;
        }
        console.log(
          this.currentNum,
          this.activeDate,
          this.taskInfoListM.mr2,
          index
        );
        //   return;
        if (this.currentNum != index) {
          this.$http
            .post("/api/api.php", {
              id: "switchMr",
              link: this.taskInfoListM.babyId,
              status: index
            })
            .then(data => {
              const result = data.data;
              if (this.activeDate == "默认") {
                _this.person[_this.currentId].mr2 = 0;
              } else if (this.activeDate == "默认2") {
                _this.person[_this.currentId].mr2 = 1;
              }
              console.log(_this.person[_this.currentId].mr2);
            });
        }

        let keyword;
        this.$message({
          message: "保存成功！",
          type: "success"
        });
        for (let i in _this.taskInfoListM.keywords) {
          console.log(_this.taskInfoListM.keywords[i].keyword);
          keyword = _this.taskInfoListM.keywords[i].keyword;
          if (keyword.indexOf("€") != -1) {
            _this.$message({
              message: "关键词不能为淘口令",
              type: "error"
            });
            return;
          }
        }
        this.$refs["form"].validate(valid => {
          if (valid) {
            _this.$http
              .post("/api/api.php", {
                id: "setDefaultTemplate",
                day: _this.activeDate,
                babyId: _this.taskInfoListM.babyId,
                template: JSON.stringify(_this.taskInfoListM)
              })
              .then(function (response) {
                //_this.templateList = response.data.data;
              });
          } else {
            console.log("验证不通过");
          }
        });
      },
      getDefaultTemplate() {
        let _this = this;
        _this.$http
          .post("/api/api2.php", {
            id: "getDefaultTemplate",
            babyId: _this.taskInfoListM.babyId,
            day: _this.activeDate
          })
          .then(function (response) {
            _this.taskInfoListM = response.data.data;
            //   _this.taskNum=
          });
      },
      taskHidden(a) {
        let _this = this;

        _this
          .$confirm("您确定隐藏 " + a.link + " 的任务吗", "提示", {
            confirmButtonText: "提交",
            cancelButtonText: "取消",
            customClass: "custom"
          })
          .then(() => {
            _this.$http
              .post("/api/api.php", {
                id: "taskHidden",
                link: a.link
              })
              .then(function (response) {
                _this.$message({
                  message: response.data.msg,
                  type: response.data.status
                });
                _this.getRanPerson();
              });
          });
      },
      taskMeditorStatus(a, b) {
        let _this = this;
        // _this.person[b]["status"] = 0;
        _this.$http
          .post("/api/api.php", {
            id: "taskMeditorStatus",
            status: a.status,
            link: a.link
          })
          .then(function (response) {
            _this.$message({
              message: response.data.msg,
              type: response.data.status
            });
            //_this.person
            //   _this.getRanPerson();
          });
      },
      taskMeditor(a) {
        let _this = this;
        _this.lr = a;
        _this.taskInfoListM = a.template;
        _this.taskInfoListM.fid = a.fid;
        _this.taskInfoListM.id = a.id;
        //_this.activeDate = '默认';
        _this.taskInfoListM.yhtkl = true;
        _this.taskInfoListM.zdtz = true;
        _this.dialogTask1 = true;
        _this.addTaskType = "0";
        if (!_this.taskInfoListM.tips) {
          _this.taskInfoListM.tips = "立即五分不带字好评！";
        }

        _this.getTemplateList();
        this.currentNum = a.mr2;
        //   this.$set(this.taskInfoListM, "mr2", a.mr2);
        a.mr2 == "0" ? _this.activeDay("默认") : _this.activeDay("默认2");
        !this.taskInfoListM.zcsj
          ? (this.taskInfoListM.zcsj = new Date("2018/11/20 00:00:00").getTime())
          : 0;
        !this.taskInfoListM.ypd ? (this.taskInfoListM.ypd = 25) : 0;
        !this.taskInfoListM.zpd ? (this.taskInfoListM.zpd = 5) : 0;
        !this.taskInfoListM.ypdx ? (this.taskInfoListM.ypdx = true) : 0;
        !this.taskInfoListM.zpdx ? (this.taskInfoListM.zpdx = true) : 0;
        this.taskInfoListM.zcsjx = false;
        // console.log(this.taskInfoListM.type);
        //   _this.activeDay("默认", a.mr2);
        _this.taskInfoListM.id = a.id;
        _this.getLinkDayNum(_this.taskInfoListM.babyId);
      },
      getTemplateList() {
        if (this.tableData4.length <= 0) {
          this.dialoging = true
        } else {
          let _this = this;
          _this.$http
            .post("/api/api.php", {
              id: "getTemplateList"
            })
            .then(function (response) {
              _this.templateList = response.data.data;
              _this.templateList.push({
                addTime: "",
                cooperate_user: "",
                id: 0,
                name: "--请选择--"
              });
              _this.dialogTask1 = true;
              _this.addTaskType = '0';
            });
        }

      },
      addProfitUp() {
        let _this = this;
        /* _this.profitData.link = '';*/
        _this.$http
          .post("/api/link.php", {
            id: "addProfitUp",
            data: JSON.stringify(_this.profitData),
            time: _this.value1
          })
          .then(function (response) {
            _this.getRanPerson();
          });
        _this.profitShow = false;
      },
      addProfit(a, b, c, d) {
        console.log(a, b, c, d);
        if (b.property === "link_profit") {
          this.profitShow = true;
          this.profitData.link = a.link;
        }
      },
      // getUpImg() {
      //     let _this = this;
      //     _this.$http
      //         .post("/api/ranking.php", {
      //             id: "getUpImg",
      //             time: _this.value1
      //         })
      //         .then(function (response) {
      //             _this.UpImg = response.data.data.list;
      //         });
      // },
      getRankingNum() {
        let _this = this;
        _this.$http
          .post("/api/ranking.php", {
            id: "getRankingNum",
            time: _this.value1
          })
          .then(function (response) {
            _this.RankingNum = response.data.data;
          });
      },
      getSjMoney() {
        let _this = this;
        _this.$http
          .post("/cron/sj.php", {
            id: "getRankingNum"
          })
          .then(function (response) {
            _this.sjMoney2 = response.data;
          });
      },
      getRanPerson() {
        let _this = this;
        _this.$http
          .post("/api/link.php", {
            id: "v2",
            time: _this.value1
          })
          .then(function (response) {
            let data = response.data.data;
            let users = response.data.users;
            _this.initArr = data;
            data.forEach(item => {
              item.zj == 1
                ? _this.zjOption.push(item)
                : _this.sjOption.push(item);
            });
            _this.person = _this.zjOption;
            for (let key in users) {
              if (key) {
                _this.peopleOptions.push({label: key, value: users[key]});
              }
            }
            _this.ranPersonAddTime = response.data.addTime;
            for (let key in data) {
              if (data[key]["zj"] == 1) {
                _this.zjMoney += data[key].money;
              } else {
                _this.sjMoney += data[key].money;
              }
            }
          })
          .then(() => {
            this.person.sort(this.descFun("num"));
          });
      },
      getUserRankingNum() {
        let _this = this;
        _this.$http
          .post("/api/ranking.php", {
            id: "getUserRankingNum",
            time: _this.value1
          })
          .then(function (response) {
            _this.UserRankingNum = response.data.data;
          });
      },
      change(a) {
        this.getUserRankingNum();
        this.getRanPerson();
        // this.getUpImg();
      },
      activeDay(a) {
        let _this = this;
        this.activeDate = a;
        this.taskInfoListM = Object.assign({}, this.taskInfoListM, {a: 1});
        let babyId = _this.taskInfoListM.babyId;
        _this.$http
          .post("/api/api2.php", {
            id: "getDefaultTemplate",
            day: _this.activeDate,
            babyId: _this.taskInfoListM.babyId
          })
          .then(function (response) {
            if (response.data.data) {
              _this.taskInfoListM = response.data.data;
              console.log(_this.taskInfoListM);
              _this.taskInfoListM.type
                ? 1
                : (_this.taskInfoListM.type = "超级爆款模式");
              let keywords = response.data.data.keywords;
              let num = 0;
              for (var key in keywords) {
                if (keywords[key].keyword.trim() !== "") {
                  num++;
                }
              }
              _this.taskNum = num;
              console.log(_this.taskNum);

            } else {
              _this.taskInfoListM.nums = _this.taskInfoListM2.nums;
            }

            if (
              !_this.taskInfoListM.nums[0].dgjc1 ||
              !_this.taskInfoListM.nums[0].dgjc3
            ) {
              for (let d in _this.taskInfoListM.nums) {
                _this.taskInfoListM.nums[d].dgjc1 = {
                  toNum: [],
                  toNumZ: "",
                  toNumX: ""
                };

                _this.taskInfoListM.nums[d].dgjc2 = {
                  toNum: [],
                  toNumZ: "",
                  toNumX: ""
                };
                _this.taskInfoListM.nums[d].dgjc3 = {
                  toNum: [],
                  toNumZ: "",
                  toNumX: ""
                };
              }
            }
            if (!_this.taskInfoListM.dgjcgroup1) {
              _this.taskInfoListM.dgjcgroup1 = "无";
              _this.taskInfoListM.dgjcgroup2 = "无";
              _this.taskInfoListM.dgjc = false;
            }

            console.log(_this.taskInfoListM);

            if (!_this.taskInfoListM.tips) {
              _this.taskInfoListM.tips = "立即五分不带字好评！";
            }
          });
      }
    },
    created() {
      this.getManager();
    },
    mounted() {
      //this.getPrice();
      this.getTaskList();
      this.getCommission();
      this.getShopList();
      let myDate = new Date();
      this.Month = myDate.getMonth() + 1;
      this.DateDay = myDate.getDate();
      this.activeDate = this.DateDay;
      let now = new Date();
      // console.log(this.taskInfoListM);
      this.taskInfoListM.time = now.setHours(0, 0, 0, 0);
      switch (true) {
        case [1, 3, 5, 7, 8, 10, 12].indexOf(this.Month) != -1:
          this.dayNum = 31;
          break;
        case [4, 6, 9, 11].indexOf(this.Month) != -1:
          this.dayNum = 30;
          break;
        default:
          if (myDate.getFullYear() % 4 == 0) {
            this.dayNum = 29;
          }
          this.dayNum = 28;
          break;
      }
    },
    created() {
      /*this.init()*/
    }
  };
</script>

<style lang="scss">
  .adminTask {
    .paperz {
      height: 90%;
      padding: 15px;
    }

    .demo-table-expand {
      font-size: 0;
      margin-left: 49.5px;
    }

    .demo-table-expand label {
      width: 90px;
      color: #99a9bf;
    }

    .demo-table-expand .el-form-item {
      margin-right: 0;
      margin-bottom: 0;
      width: 100%;
    }

    .taskDialog {
      width: 760px;
    }

    .taskDialog1 {
      width: 1315.5px;
    }

    .taskDialog2 {
      width: 1315.5px;
    }

    .adminTask .el-form-item__content {
      // margin-top:-13px;
    }

    .el-button {
      // margin-top:-13px;
    }

    .el-dialog__body {
      display: flex;
      justify-content: center;
    }

    .el-dialog__body .el-form {
      flex: 1;
    }

    .el-dialog__body .tttt .el-dialog__body {
      padding: 5px;
    }

    .tttt .el-form-item {
      margin-bottom: 6px;
    }

    .tttt .el-form-item__label {
      line-height: 23px;
    }

    .tttt .el-form-item__content {
      line-height: 23px;
    }

    .el-select__caret {
      margin-left: -20px !important;
    }

    .blcok {
      /* margin: 10px 30px;*/
      border: 1px solid #d8d8d8;
      /* padding: 10px 0 0 20px;*/
    }

    .blockone {
      text-align: center;
    }

    .el-input--mini .el-input__icon {
      line-height: 14px;
    }

    .el-select .el-input .el-select__caret {
      margin-left: -105px;
    }

    .el-radio + .el-radio {
      margin-left: 10px;
    }

    .activeDateClass {
      color: #fff;
      background-color: #409eff;
      border-color: #409eff;
    }

    .activeDateClass:hover {
      color: #fff;
      background-color: #409eff;
    }

    .el-input.is-disabled .el-input__inner {
      color: #6a6d73;
      width: 103%;
    }

    .el-dialog__body {
      padding-bottom: 0;
    }

    .el-dialog__footer {
      text-align: left;
    }

    .Puttingtime {
      display: inline-block;
      width: 52px;
      text-align: center;
    }

    .el-dialog__footer {
      padding: 0 22px 8px;
    }

    .el-form-item__content {
      line-height: 20px;
    }

    .task_total span {
      margin: 0 5px;
      color: #3f35f4;
    }

    .tipsShow {
      color: #3f35f4;
    }

    .el-form-item--mini {
      display: flex;
      justify-content: flex-start;
      align-items: center;
    }

    .el-form-item__content {
      margin-left: 0 !important;
    }

    .el-table .cell {
      text-align: center;
    }

    .el-form-item__error {
      padding-top: 4px;
    }

    .formInput {
      width: 190px;
      outline: none;
      margin-left: -12px;
      border-radius: 4px;
      padding: 0 15px;
      line-height: 26px;
      border: 1px solid #dcdfe6;
      background-size: 13px 13px;
      background-repeat: no-repeat;
    }

    .formInput:focus {
      border-color: #409eff;
    }

    .formInput_error {
      border-color: #f56c6c !important;
      background: url("../../assets/form_error.png") 165px no-repeat;
      background-size: 14px 14px;
    }

    .formInput_true {
      border-color: #67c23a !important;
      background: url("../../assets/form_true.png") 165px no-repeat;
      background-size: 14px 14px;
    }

    .adminTask .el-form-item__content {
      position: relative;
    }

    .formerror_box {
      display: none;
      position: absolute;
      color: #f56c6c;
      font-size: 12px;
    }

    .backupdedleteUserDialog {
      width: 500px;
    }

    .el-table .purpleColour {
      background: #d1d7ff;
    }

    .el-table .yellowColour {
      background: #ffe69f;
    }

    .el-table .orangeColour {
      background: #ff976a;
    }

    #ranking_bkyy {
      position: relative;
    }

    .paperz {
      height: 90%;
      padding: 15px;
    }

    .demo-table-expand {
      font-size: 0;
      margin-left: 49.5px;
    }

    .demo-table-expand label {
      width: 90px;
      color: #99a9bf;
    }

    .demo-table-expand .el-form-item {
      margin-right: 0;
      margin-bottom: 0;
      width: 100%;
    }

    .taskDialog {
      width: 760px;
    }

    .taskDialog1 {
      //   border: 1px solid red;
      width: 1750px;

      .el-form {
        // border: 1px solid red;

        .one {
          //   border: 1px solid blue;
          display: flex;
          height: 55px;

          .el-radio {
            padding-top: 5px;
          }

          .el-form-item {
            height: 100%;
            // border: 1px solid green;
            flex: 1;
            display: flex;
            align-items: center;

            .el-form-item__content,
            .el-input {
              flex: 1;
              display: flex;
            }
          }
        }

        .two {
          //   border: 1px solid blue;
          display: flex;
          height: 55px;

          .el-form-item {
            height: 100%;
            // border: 1px solid green;
            display: flex;
            align-items: center;
            display: flex;

            .el-form-item__content,
            .el-input {
              flex: 1;
              display: flex;
            }
          }
        }

        .three {
          //   border: 1px solid green;

          height: 40px;
          display: flex;
          align-items: center;

          > span {
            // border: 1px solid red;
            margin-right: 10px;
          }

          .el-form-item {
            // border: 1px solid red;
            margin-bottom: 0 !important;
            height: 100%;
            display: flex;
            align-items: center;
          }
        }

        .four {
          //   border: 1px solid red;
          height: 40px;
          display: flex;
          align-items: center;

          .el-form-item {
            // border: 1px solid red;
            margin-bottom: 0 !important;
            height: 100%;
            display: flex;
            align-items: center;

            .el-input__inner {
              height: 28px;
            }

            .el-input__prefix i,
            .el-input__suffix i {
              display: flex;
              align-items: center;
            }
          }
        }

        .t {
          //   border: 1px solid red;
          width: 100%;
          display: flex;
          margin: 20px 0;

          .left {
            // border: 1px solid blue;
            width: 67%;
            margin-right: 30px;

            > div {
              border: 1px solid #dfdddd;
              height: 50px;
              display: flex;
              align-items: center;

              > font {
                color: lightcoral;
                margin-right: 10px;
                font-size: 16px;
                font-weight: 600;
              }

              .el-form-item {
                margin-bottom: 0 !important;
                height: 100%;
                // border: 1px solid green;
                display: flex;
                align-items: center;
                margin-left: 5px;
              }
            }
          }

          .right {
            // border: 1px solid green;
            border: 1px solid #dfdddd;
            width: 30%;

            .el-form-item:first-child {
              height: 45px;
              display: flex;
              align-items: center;
            }
          }
        }
      }
    }

    .el-dialog__body {
      padding: 5px;
    }

    .el-form-item {
      margin-bottom: 6px;
    }

    .el-form-item__label {
      line-height: 18px;
    }

    .el-form-item__content {
      line-height: 18px;
    }

    .tbb {
      margin-left: 435px;
    }

    a {
      color: #3f35f4;
    }

    .pc_rank_header {
      text-align: center;
    }

    .pc_rank_header > div span {
      display: inline-block;
      width: 200px;
    }

    .day_rank_content span {
      color: lightcoral;
    }

    .day_rank_content p {
      margin: 0;
    }

    .day_rank_content_wrap {
      display: flex;
      border-bottom: 1px solid #e6e6e6;
    }

    .day_rank_content_wrap:first-of-type {
      border-top: 1px solid #e6e6e6;
    }

    .day_rank_content_wrap > div {
      flex: 1;
      text-align: center;
    }

    .day_rank_content_wrap .day_rank_content:not(:last-of-type) {
      border-right: 1px solid #e6e6e6;
    }

    .day_rank h3 {
      text-align: center;
    }

    .group_rank {
      padding: 18px 5px;
    }

    .group_rank {
      text-align: center;
    }

    .day_group_rank {
      display: flex;
      text-align: center;
    }

    .day_group_rank div {
      flex: 1;
      border: 1px solid #dddddd;
    }

    .adminTask_select select {
      cursor: pointer;
      outline: none;
      border-radius: 5px;
      border: 1px solid #dcdfe6;
      line-height: 28px;
      height: 28px;
      padding: 0 18px;
      color: #606266;
    }

    .adminTask_select select:focus {
      border-color: #409eff;
    }

    .select_up {
      display: inline-block;
      position: relative;
      left: -29px;
      top: 2px;
      width: 16px;
      height: 16px;
      transform: rotate(0deg);
      background: url("../../assets/select_down.png") right center no-repeat;
      background-size: 16px 16px;
    }

    .rotateUp {
      transition: 0.2s ease;
      transform: rotate(180deg);
    }

    select {
      appearance: none;
      -moz-appearance: none;
      -webkit-appearance: none;
      -ms-appearance: none;
    }

    select::-ms-expand {
      display: none;
    }

    .keywordsVal {
      position: relative;
      top: 25px;
      left: 20px;
    }

    .keywordsVal .el-form-item__error {
      margin-left: 100px;
    }

    .task .el-dialog__body {
      padding-left: 20px;
    }

    .coupon_setting {
      display: flex;
      align-items: center;
      width: 1150px;
      padding: 5px;
      border: 1px solid #dfdddd;
    }

    .coupon_setting .el-form-item--mini.el-form-item {
      margin-bottom: 0;
    }

    .task_num span {
      color: lightcoral;
    }

    .coupon_item {
      display: inline-block;
      margin: 5px 0;
    }

    .keywordsVal {
      position: relative;
      top: 25px;
      left: 20px;
    }

    .keywordsVal .el-form-item__error {
      margin-left: 100px;
    }

    .task .el-dialog__body {
      padding-left: 20px;
    }

    select.adminTask_select {
      cursor: pointer;
      outline: none;
      border-radius: 5px;
      border: 1px solid #dcdfe6;
      line-height: 28px;
      height: 28px;
      padding: 0 20px;
      color: #606266;
    }

    select.adminTask_select {
      cursor: pointer;
      width: 80px;
    }

    select.adminTask_select:focus {
      border-color: #409eff;
    }

    .diyA {
      font-size: 12px;
      display: inline-block;
      padding: 5px 10px;
      border-radius: 3px;
      color: #fff;
      background-color: #409eff;
      box-sizing: border-box;
    }

    .purple {
      background-color: #f56c6c !important;
    }

    .chengbendia {
      width: 750px;
    }

    .first_el_table {
      padding: 0 !important;
    }

    .companyFilterWrap {
      display: flex;
      justify-content: center;
      margin: 30px;
    }

    .companyFilter {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .over {
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }

    .el-table .cell {
      display: flex;
      align-items: center;
    }

    .rowbg_pause {
      background: #409eff;
    }

    .rowbg_pause2 {
      background: rgb(248, 146, 248) !important;
    }

    .rowbg_start {
      background: #f56c6c;
    }

    .producetName {
      display: block;
      color: black;
      width: 140px;
      padding: 10px 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .producetName:hover {
      background: #99a9bf;
    }

    .hot .cell {
      padding: 0 !important;
      text-align: center;
      height: 40px;
    }

    .up {
      color: #ff0000 !important;
    }

    .down {
      color: #008000 !important;
    }

    .normal {
      color: #606266 !important;
    }

    .el-table .cell {
      text-align: center;
    }

    .hardLabel {
      display: inline-block;
      background: rgb(245, 247, 250);
      border: 1px solid #ddd;
      padding: 2px 5px;
    }

    .hardLabel:first-of-type {
      border-right: 1px solid #ddd;
    }

    .tipsShow {
      color: #3f35f4;
    }

    .name {
      max-width: 80px;
    }

    .first_place,
    .second_place,
    .third_place {
      display: inline-block;
      float: right;
      width: 32px;
      height: 32px;
      background: url("../../assets/first_place.png") no-repeat;
    }

    .second_place {
      background: url("../../assets/second_place.png") no-repeat;
    }

    .third_place {
      background: url("../../assets/third_place.png") no-repeat;
    }

    .day_bj_warning {
      background-color: #e4213f;
      color: #ffff !important;
      display: block;
      width: 80px;
      padding: 10px 0;
    }

    .el-table .cell {
      text-align: center !important;
    }

    .red {
      background-color: rgb(248, 146, 248) !important;
    }

    .coupon_setting_wrap {
      float: left;
      width: 1150px;
    }

    .el-picker-panel {
      top: 180px !important;
      left: 180px !important;
    }
  }

  .el-form-item--mini.el-form-item, .el-form-item--small.el-form-item {
    margin-bottom: 18px;
  }

  .el-form--inline .el-form-item {
    margin-right: 10px;
  }

  .el-form--inline .el-form-item, .el-form--inline .el-form-item__content {
    display: inline-block;
    vertical-align: top;
  }

  .keywordsVal {
    position: relative;
    top: 25px;
    left: 20px;
  }
</style>
